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

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

Issue 29555834: Issue 5773 - Older Opera and Chrome don't have an iterable CSSRuleList (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Pass eslint. Created Sept. 25, 2017, 6:04 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 let stylesheet = stylesheets[i]; 423 let stylesheet = stylesheets[i];
424 // Explicitly ignore third-party stylesheets to ensure consistent behavior 424 // Explicitly ignore third-party stylesheets to ensure consistent behavior
425 // between Firefox and Chrome. 425 // between Firefox and Chrome.
426 if (!this.isSameOrigin(stylesheet)) 426 if (!this.isSameOrigin(stylesheet))
427 continue; 427 continue;
428 428
429 let rules = stylesheet.cssRules; 429 let rules = stylesheet.cssRules;
430 if (!rules) 430 if (!rules)
431 continue; 431 continue;
432 432
433 for (let rule of rules) 433 // Chrome < 51 doesn't have an iterable CSSRuleList
434 // https://issues.adblockplus.org/ticket/5773
435 for (let j = 0; j < rules.length; j++)
434 { 436 {
437 let rule = rules[j];
435 if (rule.type != rule.STYLE_RULE) 438 if (rule.type != rule.STYLE_RULE)
436 continue; 439 continue;
437 440
438 cssStyles.push(stringifyStyle(rule)); 441 cssStyles.push(stringifyStyle(rule));
439 } 442 }
440 } 443 }
441 444
442 let {document} = this.window; 445 let {document} = this.window;
443 446
444 let patterns = this.patterns.slice(); 447 let patterns = this.patterns.slice();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 subtree: true 610 subtree: true
608 } 611 }
609 ); 612 );
610 document.addEventListener("load", this.onLoad.bind(this), true); 613 document.addEventListener("load", this.onLoad.bind(this), true);
611 } 614 }
612 }); 615 });
613 } 616 }
614 }; 617 };
615 618
616 exports.ElemHideEmulation = ElemHideEmulation; 619 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