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

Unified Diff: include.preload.js

Issue 29365801: Issue 4676 - Replace non-standard CSSStyleSheet.addRule() call by CSSStyleSheet.insertRule() (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome
Patch Set: Changed indentation Created Nov. 30, 2016, 1:50 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: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -575,17 +575,18 @@ ElemHide.prototype = {
// Safari only allows 8192 primitive selectors to be injected at once[1], we
// therefore chunk the inserted selectors into groups of 200 to be safe.
// (Chrome also has a limit, larger... but we're not certain exactly what it
// is! Edge apparently has no such limit.)
// [1] - https://github.com/WebKit/webkit/blob/1cb2227f6b2a1035f7bdc46e5ab69debb75fc1de/Source/WebCore/css/RuleSet.h#L68
for (var i = 0; i < selectors.length; i += this.selectorGroupSize)
{
var selector = selectors.slice(i, i + this.selectorGroupSize).join(", ");
- this.style.sheet.addRule(selector, "display: none !important;");
+ this.style.sheet.insertRule(selector + "{display: none !important;}",
+ this.style.sheet.cssRules.length);
}
},
apply: function()
{
var selectors = null;
var propertyFiltersLoaded = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld