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

Delta Between Two Patch Sets: lib/content/elemHideEmulation.js

Issue 30002601: Issue 7284 - Move CSS escaping to createStyleSheet (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Reworked the escaping of selectors Created Feb. 12, 2019, 11:50 p.m.
Right Patch Set: more nits Created Feb. 18, 2019, 1:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/elemHide.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 } 342 }
343 } 343 }
344 344
345 class ContainsSelector 345 class ContainsSelector
346 { 346 {
347 constructor(textContent) 347 constructor(textContent)
348 { 348 {
349 this.dependsOnDOM = true; 349 this.dependsOnDOM = true;
350 this.dependsOnCharacterData = true; 350 this.dependsOnCharacterData = true;
351
351 this._regexp = makeRegExpParameter(textContent); 352 this._regexp = makeRegExpParameter(textContent);
352 } 353 }
353 354
354 *getSelectors(prefix, subtree, styles, targets) 355 *getSelectors(prefix, subtree, styles, targets)
355 { 356 {
356 for (let element of this.getElements(prefix, subtree, styles, targets)) 357 for (let element of this.getElements(prefix, subtree, styles, targets))
357 yield [makeSelector(element), subtree]; 358 yield [makeSelector(element), subtree];
358 } 359 }
359 360
360 *getElements(prefix, subtree, styles, targets) 361 *getElements(prefix, subtree, styles, targets)
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 characterData: shouldObserveCharacterData(this.patterns), 964 characterData: shouldObserveCharacterData(this.patterns),
964 subtree: true 965 subtree: true
965 } 966 }
966 ); 967 );
967 this.document.addEventListener("load", this.onLoad.bind(this), true); 968 this.document.addEventListener("load", this.onLoad.bind(this), true);
968 } 969 }
969 } 970 }
970 } 971 }
971 972
972 exports.ElemHideEmulation = ElemHideEmulation; 973 exports.ElemHideEmulation = ElemHideEmulation;
LEFTRIGHT
« no previous file | lib/elemHide.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld