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

Unified Diff: chrome/content/elemHideEmulation.js

Issue 29378674: Issue 4962 - Fix the tests.- Fix syntax in chrome/content/elemHideEmulation.js to use ES5Regress… (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: changes following feedback Created March 8, 2017, 1:35 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 | test/browser/elemHideEmulation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/elemHideEmulation.js
===================================================================
--- a/chrome/content/elemHideEmulation.js
+++ b/chrome/content/elemHideEmulation.js
@@ -78,33 +78,36 @@ ElemHideEmulation.prototype = {
findSelectors: function(stylesheet, selectors, filters)
{
// Explicitly ignore third-party stylesheets to ensure consistent behavior
// between Firefox and Chrome.
if (!this.isSameOrigin(stylesheet))
return;
- let rules = stylesheet.cssRules;
+ var rules = stylesheet.cssRules;
if (!rules)
return;
- for (let rule of rules)
+ for (var i = 0; i < rules.length; i++)
{
+ var rule = rules[i];
if (rule.type != rule.STYLE_RULE)
continue;
- let style = this.stringifyStyle(rule.style);
- for (let pattern of this.patterns)
+ var style = this.stringifyStyle(rule.style);
+ for (var j = 0; j < this.patterns.length; j++)
{
+ var pattern = this.patterns[j];
if (pattern.regexp.test(style))
{
- let subSelectors = splitSelector(rule.selectorText);
- for (let subSelector of subSelectors)
+ var subSelectors = splitSelector(rule.selectorText);
+ for (var k = 0; k < subSelectors.length; k++)
{
+ var subSelector = subSelectors[k];
selectors.push(pattern.prefix + subSelector + pattern.suffix);
filters.push(pattern.text);
}
}
}
}
},
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld