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: formatting fixes Created March 8, 2017, 12:42 a.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') | test/browser/elemHideEmulation.js » ('J')
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,38 +78,39 @@ 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);
+ this.patterns.forEach(function(pattern)
Wladimir Palant 2017/03/08 10:31:50 Last I checked, calling forEach caused suboptimal
{
if (pattern.regexp.test(style))
{
- let subSelectors = splitSelector(rule.selectorText);
- for (let subSelector of subSelectors)
+ var subSelectors = splitSelector(rule.selectorText);
+ subSelectors.forEach(function(subSelector)
{
selectors.push(pattern.prefix + subSelector + pattern.suffix);
filters.push(pattern.text);
- }
+ });
}
- }
+ });
}
},
addSelectors: function(stylesheets)
{
var selectors = [];
var filters = [];
for (var i = 0; i < stylesheets.length; i++)
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | test/browser/elemHideEmulation.js » ('J')

Powered by Google App Engine
This is Rietveld