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

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

Issue 29582689: Noissue - Fix the escaping of '{' and '}' in CSS selectors (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Oct. 18, 2017, 6:42 p.m.
Right Patch Set: Also update the content script Created Oct. 18, 2017, 7:39 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/filterClasses.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
(no file at all)
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 }; 253 };
254 254
255 function PropsSelector(propertyExpression) 255 function PropsSelector(propertyExpression)
256 { 256 {
257 let regexpString; 257 let regexpString;
258 if (propertyExpression.length >= 2 && propertyExpression[0] == "/" && 258 if (propertyExpression.length >= 2 && propertyExpression[0] == "/" &&
259 propertyExpression[propertyExpression.length - 1] == "/") 259 propertyExpression[propertyExpression.length - 1] == "/")
260 { 260 {
261 regexpString = propertyExpression.slice(1, -1) 261 regexpString = propertyExpression.slice(1, -1)
262 .replace("\\x7B ", "{").replace("\\x7D ", "}"); 262 .replace("\\7B ", "{").replace("\\7D ", "}");
263 } 263 }
264 else 264 else
265 regexpString = filterToRegExp(propertyExpression); 265 regexpString = filterToRegExp(propertyExpression);
266 266
267 this._regexp = new RegExp(regexpString, "i"); 267 this._regexp = new RegExp(regexpString, "i");
268 } 268 }
269 269
270 PropsSelector.prototype = { 270 PropsSelector.prototype = {
271 preferHideWithSelector: true, 271 preferHideWithSelector: true,
272 dependsOnStyles: true, 272 dependsOnStyles: true,
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 characterData: true, 591 characterData: true,
592 subtree: true 592 subtree: true
593 } 593 }
594 ); 594 );
595 this.document.addEventListener("load", this.onLoad.bind(this), true); 595 this.document.addEventListener("load", this.onLoad.bind(this), true);
596 } 596 }
597 } 597 }
598 }; 598 };
599 599
600 exports.ElemHideEmulation = ElemHideEmulation; 600 exports.ElemHideEmulation = ElemHideEmulation;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld