Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29851644: Issue 6848 - Add searchSelector parameter to hide-if-contains snippet (Closed)

Created:
Aug. 9, 2018, 3:40 p.m. by Manish Jethani
Modified:
Aug. 11, 2018, 2:09 a.m.
Reviewers:
hub
CC:
kzar
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use Element.closest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -18 lines) Patch
M lib/content/snippets.js View 1 3 chunks +20 lines, -18 lines 0 comments Download

Messages

Total messages: 5
Manish Jethani
Aug. 9, 2018, 3:40 p.m. (2018-08-09 15:40:23 UTC) #1
Manish Jethani
Patch Set 1
Aug. 9, 2018, 4:04 p.m. (2018-08-09 16:04:27 UTC) #2
hub
https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippets.js File lib/content/snippets.js (right): https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippets.js#newcode136 lib/content/snippets.js:136: if (element.matches(selector)) Wouldn't https://developer.mozilla.org/en-US/docs/Web/API/Element/closest work here?
Aug. 10, 2018, 12:30 p.m. (2018-08-10 12:30:41 UTC) #3
Manish Jethani
Patch Set 2: Use Element.closest https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippets.js File lib/content/snippets.js (right): https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippets.js#newcode136 lib/content/snippets.js:136: if (element.matches(selector)) On 2018/08/10 ...
Aug. 10, 2018, 2:57 p.m. (2018-08-10 14:57:02 UTC) #4
hub
Aug. 10, 2018, 7:54 p.m. (2018-08-10 19:54:57 UTC) #5
LGTM

https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippet...
File lib/content/snippets.js (right):

https://codereview.adblockplus.org/29851644/diff/29851645/lib/content/snippet...
lib/content/snippets.js:136: if (element.matches(selector))
On 2018/08/10 14:57:02, Manish Jethani wrote:
> On 2018/08/10 12:30:41, hub wrote:
> > Wouldn't https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
work
> > here?
> 
> Ah, you're right. Element.closest is perfect.
> 
> It's only supported from Edge 15 onwards but I'm not sure we have to worry
about
> that.

We support EdgeHTML 16 and up if I read things correctly.

Powered by Google App Engine
This is Rietveld