Index: include.preload.js |
=================================================================== |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -425,21 +425,22 @@ |
preparedSelectors.push("::content " + subSelector); |
} |
} |
else |
{ |
preparedSelectors = selectors; |
} |
- // 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 |
+ // Chromium's Blink engine supports only up to 8,192 selectors; more |
Manish Jethani
2018/01/25 17:15:02
I've just updated this comment here because the pr
|
+ // specifically, it ignores any selectors that start at index 8192 or |
+ // beyond in the list of plain selectors. In order to avoid spilling |
+ // outside of this range, we simply add multiple rules in groups of up to |
+ // 200 selectors each. |
+ // See issue #6298 and https://crbug.com/804179 |
for (let i = 0; i < preparedSelectors.length; i += this.selectorGroupSize) |
{ |
let selector = preparedSelectors.slice( |
i, i + this.selectorGroupSize |
).join(", "); |
this.style.sheet.insertRule(selector + "{display: none !important;}", |
this.style.sheet.cssRules.length); |
} |