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

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

Issue 30002601: Issue 7284 - Move CSS escaping to createStyleSheet (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Updated addressing most comments Created Feb. 13, 2019, 4:33 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 | lib/elemHide.js » ('j') | lib/elemHide.js » ('J')
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 { 404 {
405 constructor(propertyExpression) 405 constructor(propertyExpression)
406 { 406 {
407 this.dependsOnStyles = true; 407 this.dependsOnStyles = true;
408 this.dependsOnDOM = true; 408 this.dependsOnDOM = true;
409 409
410 let regexpString; 410 let regexpString;
411 if (propertyExpression.length >= 2 && propertyExpression[0] == "/" && 411 if (propertyExpression.length >= 2 && propertyExpression[0] == "/" &&
412 propertyExpression[propertyExpression.length - 1] == "/") 412 propertyExpression[propertyExpression.length - 1] == "/")
413 { 413 {
414 regexpString = propertyExpression.slice(1, -1) 414 regexpString = propertyExpression.slice(1, -1);
415 .replace("\\7B ", "{").replace("\\7D ", "}");
416 } 415 }
417 else 416 else
418 regexpString = filterToRegExp(propertyExpression); 417 regexpString = filterToRegExp(propertyExpression);
419 418
420 this._regexp = new RegExp(regexpString, "i"); 419 this._regexp = new RegExp(regexpString, "i");
421 } 420 }
422 421
423 *findPropsSelectors(styles, prefix, regexp) 422 *findPropsSelectors(styles, prefix, regexp)
424 { 423 {
425 for (let style of styles) 424 for (let style of styles)
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 characterData: shouldObserveCharacterData(this.patterns), 964 characterData: shouldObserveCharacterData(this.patterns),
966 subtree: true 965 subtree: true
967 } 966 }
968 ); 967 );
969 this.document.addEventListener("load", this.onLoad.bind(this), true); 968 this.document.addEventListener("load", this.onLoad.bind(this), true);
970 } 969 }
971 } 970 }
972 } 971 }
973 972
974 exports.ElemHideEmulation = ElemHideEmulation; 973 exports.ElemHideEmulation = ElemHideEmulation;
OLDNEW
« no previous file with comments | « no previous file | lib/elemHide.js » ('j') | lib/elemHide.js » ('J')

Powered by Google App Engine
This is Rietveld