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

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

Issue 29713565: Issue 6437 - Filter out patterns that do not match DOM mutations (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Rebase Created April 24, 2018, 12:38 p.m.
Right Patch Set: Process plain selectors on DOM mutations Created April 24, 2018, 1:56 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 | test/browser/elemHideEmulation.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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // Just in case the getSelectors() generator above had to run some heavy 217 // Just in case the getSelectors() generator above had to run some heavy
218 // document.querySelectorAll() call which didn't produce any results, make 218 // document.querySelectorAll() call which didn't produce any results, make
219 // sure there is at least one point where execution can pause. 219 // sure there is at least one point where execution can pause.
220 yield null; 220 yield null;
221 } 221 }
222 222
223 function PlainSelector(selector) 223 function PlainSelector(selector)
224 { 224 {
225 this._selector = selector; 225 this._selector = selector;
226 this.maybeDependsOnAttributes = /[#.]|\[.+\]/.test(selector); 226 this.maybeDependsOnAttributes = /[#.]|\[.+\]/.test(selector);
227 this.dependsOnDOM = this.maybeDependsOnAttributes;
Manish Jethani 2018/04/24 13:58:32 OK, since Trac #6618 is rejected we have to proces
227 } 228 }
228 229
229 PlainSelector.prototype = { 230 PlainSelector.prototype = {
230 /** 231 /**
231 * Generator function returning a pair of selector 232 * Generator function returning a pair of selector
232 * string and subtree. 233 * string and subtree.
233 * @param {string} prefix the prefix for the selector. 234 * @param {string} prefix the prefix for the selector.
234 * @param {Node} subtree the subtree we work on. 235 * @param {Node} subtree the subtree we work on.
235 * @param {StringifiedStyle[]} styles the stringified style objects. 236 * @param {StringifiedStyle[]} styles the stringified style objects.
236 */ 237 */
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 characterData: shouldObserveCharacterData(this.patterns), 878 characterData: shouldObserveCharacterData(this.patterns),
878 subtree: true 879 subtree: true
879 } 880 }
880 ); 881 );
881 this.document.addEventListener("load", this.onLoad.bind(this), true); 882 this.document.addEventListener("load", this.onLoad.bind(this), true);
882 } 883 }
883 } 884 }
884 }; 885 };
885 886
886 exports.ElemHideEmulation = ElemHideEmulation; 887 exports.ElemHideEmulation = ElemHideEmulation;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld