Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Unified Diff: pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js

Issue 26391003: fix ShadowDOM on browsers with non-native template (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/shadow_dom/lib/shadow_dom.min.js ('k') | samples/samples.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js
diff --git a/pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js b/pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js
index 1b0014cf0e0fabe4b8a256552ea4d2142cece750..4bc5a56318356ed5ef132910a0a5a60eb364af3a 100644
--- a/pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js
+++ b/pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js
@@ -35,6 +35,13 @@
if (window.MutationObserver && (obj instanceof MutationObserver))
return 'MutationObserver';
+ // TODO(jmesserly): this prevents incorrect interaction between ShadowDOM
+ // and dart:html's <template> polyfill. Essentially, ShadowDOM is
+ // polyfilling native template, but our Dart polyfill fails to detect this
+ // because the unwrapped node is an HTMLUnknownElement, leading it to
+ // think the node has no content.
+ if (obj instanceof HTMLTemplateElement) return 'HTMLTemplateElement';
+
var unwrapped = unwrapIfNeeded(obj);
if (obj !== unwrapped) {
// Fix up class names for Firefox.
« no previous file with comments | « pkg/shadow_dom/lib/shadow_dom.min.js ('k') | samples/samples.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698