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

Side by Side Diff: lib/elemHide.js

Issue 29356322: Issue 4501 - Fix treatment of element hiding filters with filter key 0 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created Oct. 7, 2016, 10:11 a.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 | test/elemHide.js » ('j') | no next file with comments »
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 let selector = filter.selector; 131 let selector = filter.selector;
132 if (!(selector in exceptions)) 132 if (!(selector in exceptions))
133 exceptions[selector] = []; 133 exceptions[selector] = [];
134 exceptions[selector].push(filter); 134 exceptions[selector].push(filter);
135 135
136 // If this is the first exception for a previously unconditionally 136 // If this is the first exception for a previously unconditionally
137 // applied element hiding selector we need to take care to update the 137 // applied element hiding selector we need to take care to update the
138 // lookups. 138 // lookups.
139 let filterKey = filterKeyBySelector[selector]; 139 let filterKey = filterKeyBySelector[selector];
140 if (filterKey) 140 if (typeof filterKey != "undefined")
141 { 141 {
142 this._addToFiltersByDomain(filterKey, filterByKey[filterKey]); 142 this._addToFiltersByDomain(filterKey, filterByKey[filterKey]);
143 delete filterKeyBySelector[selector]; 143 delete filterKeyBySelector[selector];
144 unconditionalSelectors = unconditionalFilterKeys = null; 144 unconditionalSelectors = unconditionalFilterKeys = null;
145 } 145 }
146 146
147 knownExceptions[filter.text] = true; 147 knownExceptions[filter.text] = true;
148 } 148 }
149 else 149 else
150 { 150 {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 let nextDot = currentDomain.indexOf("."); 382 let nextDot = currentDomain.indexOf(".");
383 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); 383 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1);
384 } 384 }
385 385
386 if (provideFilterKeys) 386 if (provideFilterKeys)
387 return [selectors, filterKeys]; 387 return [selectors, filterKeys];
388 else 388 else
389 return selectors; 389 return selectors;
390 } 390 }
391 }; 391 };
OLDNEW
« no previous file with comments | « no previous file | test/elemHide.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld