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

Delta Between Two Patch Sets: 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/
Left Patch Set: Created Sept. 25, 2017, 6 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Chrome < 51 doesn't have an iterable CSSRuleList 433 // Chrome < 51 doesn't have an iterable CSSRuleList
434 // https://issues.adblockplus.org/ticket/5773 434 // https://issues.adblockplus.org/ticket/5773
435 for (let i = 0; i < rules.length; i++) 435 for (let j = 0; j < rules.length; j++)
436 { 436 {
437 let rule = rules[i]; 437 let rule = rules[j];
438 if (rule.type != rule.STYLE_RULE) 438 if (rule.type != rule.STYLE_RULE)
439 continue; 439 continue;
440 440
441 cssStyles.push(stringifyStyle(rule)); 441 cssStyles.push(stringifyStyle(rule));
442 } 442 }
443 } 443 }
444 444
445 let {document} = this.window; 445 let {document} = this.window;
446 446
447 let patterns = this.patterns.slice(); 447 let patterns = this.patterns.slice();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 subtree: true 610 subtree: true
611 } 611 }
612 ); 612 );
613 document.addEventListener("load", this.onLoad.bind(this), true); 613 document.addEventListener("load", this.onLoad.bind(this), true);
614 } 614 }
615 }); 615 });
616 } 616 }
617 }; 617 };
618 618
619 exports.ElemHideEmulation = ElemHideEmulation; 619 exports.ElemHideEmulation = ElemHideEmulation;
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld