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

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

Issue 29836555: Issue 6680 - PropsSelector also depend on DOM modifications (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Nits Created July 23, 2018, 9:01 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 .replace("\\7B ", "{").replace("\\7D ", "}"); 407 .replace("\\7B ", "{").replace("\\7D ", "}");
408 } 408 }
409 else 409 else
410 regexpString = filterToRegExp(propertyExpression); 410 regexpString = filterToRegExp(propertyExpression);
411 411
412 this._regexp = new RegExp(regexpString, "i"); 412 this._regexp = new RegExp(regexpString, "i");
413 } 413 }
414 414
415 PropsSelector.prototype = { 415 PropsSelector.prototype = {
416 dependsOnStyles: true, 416 dependsOnStyles: true,
417 dependsOnDOM: true,
417 418
418 *findPropsSelectors(styles, prefix, regexp) 419 *findPropsSelectors(styles, prefix, regexp)
419 { 420 {
420 for (let style of styles) 421 for (let style of styles)
421 if (regexp.test(style.style)) 422 if (regexp.test(style.style))
422 for (let subSelector of style.subSelectors) 423 for (let subSelector of style.subSelectors)
423 { 424 {
424 if (subSelector.startsWith("*") && 425 if (subSelector.startsWith("*") &&
425 !incompletePrefixRegexp.test(prefix)) 426 !incompletePrefixRegexp.test(prefix))
426 { 427 {
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 characterData: shouldObserveCharacterData(this.patterns), 979 characterData: shouldObserveCharacterData(this.patterns),
979 subtree: true 980 subtree: true
980 } 981 }
981 ); 982 );
982 this.document.addEventListener("load", this.onLoad.bind(this), true); 983 this.document.addEventListener("load", this.onLoad.bind(this), true);
983 } 984 }
984 } 985 }
985 }; 986 };
986 987
987 exports.ElemHideEmulation = ElemHideEmulation; 988 exports.ElemHideEmulation = ElemHideEmulation;
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