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

Unified Diff: lib/content/elemHideEmulation.js

Issue 29760699: Issue 6619 - Qualify CSS selectors in document style sheet correctly (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Reinclude test/common.js Created May 15, 2018, 5:18 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/common.js ('k') | test/common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/content/elemHideEmulation.js
===================================================================
--- a/lib/content/elemHideEmulation.js
+++ b/lib/content/elemHideEmulation.js
@@ -12,17 +12,18 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
-const {textToRegExp, filterToRegExp, splitSelector} = require("../common");
+const {textToRegExp, filterToRegExp, splitSelector,
+ qualifySelector} = require("../common");
const {indexOf} = require("../coreUtils");
let MIN_INVOCATION_INTERVAL = 3000;
const MAX_SYNCHRONOUS_PROCESSING_TIME = 50;
const abpSelectorRegexp = /:-abp-([\w-]+)\(/i;
function getCachedPropertyValue(object, name, defaultValueFunc = () => {})
{
@@ -379,17 +380,17 @@
if (subSelector.startsWith("*") &&
!incompletePrefixRegexp.test(prefix))
{
subSelector = subSelector.substr(1);
}
let idx = subSelector.lastIndexOf("::");
if (idx != -1)
subSelector = subSelector.substr(0, idx);
- yield prefix + subSelector;
+ yield qualifySelector(subSelector, prefix);
}
},
*getSelectors(prefix, subtree, styles)
{
for (let selector of this.findPropsSelectors(styles, prefix, this._regexp))
yield [selector, subtree];
}
« no previous file with comments | « lib/common.js ('k') | test/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld