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

Unified Diff: lib/content/elemHideEmulation.js

Issue 29557741: Issue 5773 - use ES6 for stylesheets and cssRules. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 27, 2017, 11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/content/elemHideEmulation.js
===================================================================
--- a/lib/content/elemHideEmulation.js
+++ b/lib/content/elemHideEmulation.js
@@ -406,35 +406,29 @@
let elementFilters = [];
let cssStyles = [];
let stylesheetOnlyChange = !!stylesheets;
if (!stylesheets)
stylesheets = this.document.styleSheets;
- // Chrome < 51 doesn't have an iterable StyleSheetList
- // https://issues.adblockplus.org/ticket/5381
- for (let i = 0; i < stylesheets.length; i++)
+ for (let stylesheet of stylesheets)
{
- let stylesheet = stylesheets[i];
// Explicitly ignore third-party stylesheets to ensure consistent behavior
// between Firefox and Chrome.
if (!this.isSameOrigin(stylesheet))
continue;
let rules = stylesheet.cssRules;
if (!rules)
continue;
- // Chrome < 51 doesn't have an iterable CSSRuleList
- // https://issues.adblockplus.org/ticket/5773
- for (let j = 0; j < rules.length; j++)
+ for (let rule of rules)
{
- let rule = rules[j];
if (rule.type != rule.STYLE_RULE)
continue;
cssStyles.push(stringifyStyle(rule));
}
}
let patterns = this.patterns.slice();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld