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

Unified Diff: include.preload.js

Issue 29714555: Issue 6441 - Avoid unnecessary shadow root (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use <content> if <shadow> is not supported Created March 5, 2018, 12:47 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
@@ -370,17 +370,21 @@
if (/\.(?:google|blogger)\.com$/.test(document.domain))
return null;
// Finally since some users have both AdBlock and Adblock Plus installed we
// have to consider how the two extensions interact. For example we want to
// avoid creating the shadowRoot twice.
let shadow = document.documentElement.shadowRoot ||
document.documentElement.createShadowRoot();
- shadow.appendChild(document.createElement("shadow"));
+
+ // Firefox does not support the <shadow> tag (#6441).
+ let contentTagName = typeof HTMLShadowElement != "undefined" ?
+ "shadow" : "content";
Sebastian Noack 2018/03/08 18:34:26 I wonder whether we should just use <content> no m
Manish Jethani 2018/03/08 19:44:54 Are you sure that Chrome 49 supports <content>? I
Manish Jethani 2018/03/08 19:53:57 I checked the Chromium commit log and entries ment
Sebastian Noack 2018/03/08 20:36:16 Yes, I'm pretty sure <content> already existed whe
+ shadow.appendChild(document.createElement(contentTagName));
return shadow;
},
addSelectorsInline(selectors, groupName)
{
let style = this.styles.get(groupName);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld