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

Side by Side Diff: chrome/content/elemHideEmulation.js

Issue 29481700: Issue 5339 - Properly select element for pseudo-element (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Reworked based on the new implementation proposal. Created Aug. 8, 2017, 4:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 *findPropsSelectors(styles, prefix, regexp) 282 *findPropsSelectors(styles, prefix, regexp)
283 { 283 {
284 let actualPrefix = (prefix && !incompletePrefixRegexp.test(prefix)) ? 284 let actualPrefix = (prefix && !incompletePrefixRegexp.test(prefix)) ?
285 prefix + " " : prefix; 285 prefix + " " : prefix;
286 for (let style of styles) 286 for (let style of styles)
287 if (regexp.test(style.style)) 287 if (regexp.test(style.style))
288 for (let subSelector of style.subSelectors) 288 for (let subSelector of style.subSelectors)
289 { 289 {
290 if (subSelector == "*") 290 if (subSelector == "*")
291 subSelector = ""; 291 subSelector = "";
292 else
293 {
294 let idx = subSelector.lastIndexOf("::");
295 if (idx != -1)
296 subSelector = subSelector.substr(0, idx);
297 }
292 yield actualPrefix + subSelector; 298 yield actualPrefix + subSelector;
293 } 299 }
294 }, 300 },
295 301
296 *getSelectors(prefix, subtree, styles) 302 *getSelectors(prefix, subtree, styles)
297 { 303 {
298 for (let selector of this.findPropsSelectors(styles, prefix, this._regexp)) 304 for (let selector of this.findPropsSelectors(styles, prefix, this._regexp))
299 yield [selector, subtree]; 305 yield [selector, subtree];
300 } 306 }
301 }; 307 };
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 517
512 if (this.patterns.length > 0) 518 if (this.patterns.length > 0)
513 { 519 {
514 let {document} = this.window; 520 let {document} = this.window;
515 this.addSelectors(); 521 this.addSelectors();
516 document.addEventListener("load", this.onLoad.bind(this), true); 522 document.addEventListener("load", this.onLoad.bind(this), true);
517 } 523 }
518 }); 524 });
519 } 525 }
520 }; 526 };
OLDNEW
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld