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

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

Issue 29713583: Issue 6504 - Add useInlineStyles flag to ElemHideEmulation (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created March 2, 2018, 1:52 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 | no next file » | 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-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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 pattern = null; 566 pattern = null;
567 return processPatterns(); 567 return processPatterns();
568 } 568 }
569 generator = evaluate(pattern.selectors, 0, "", 569 generator = evaluate(pattern.selectors, 0, "",
570 this.document, cssStyles); 570 this.document, cssStyles);
571 } 571 }
572 for (let selector of generator) 572 for (let selector of generator)
573 { 573 {
574 if (selector != null) 574 if (selector != null)
575 { 575 {
576 if (isSelectorHidingOnlyPattern(pattern)) 576 if (this.alwaysHideWithSelector ||
577 isSelectorHidingOnlyPattern(pattern))
577 { 578 {
578 selectors.push(selector); 579 selectors.push(selector);
579 selectorFilters.push(pattern.text); 580 selectorFilters.push(pattern.text);
580 } 581 }
581 else 582 else
582 { 583 {
583 for (let element of this.document.querySelectorAll(selector)) 584 for (let element of this.document.querySelectorAll(selector))
584 { 585 {
585 elements.push(element); 586 elements.push(element);
586 elementFilters.push(pattern.text); 587 elementFilters.push(pattern.text);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 characterData: shouldObserveCharacterData(this.patterns), 713 characterData: shouldObserveCharacterData(this.patterns),
713 subtree: true 714 subtree: true
714 } 715 }
715 ); 716 );
716 this.document.addEventListener("load", this.onLoad.bind(this), true); 717 this.document.addEventListener("load", this.onLoad.bind(this), true);
717 } 718 }
718 } 719 }
719 }; 720 };
720 721
721 exports.ElemHideEmulation = ElemHideEmulation; 722 exports.ElemHideEmulation = ElemHideEmulation;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld