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

Unified Diff: pkg/web_components/lib/dart_support.js

Issue 182193002: [polymer] interop with polymer-element and polymer.js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/web_components/lib/build.log ('k') | pkg/web_components/lib/platform.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/web_components/lib/dart_support.js
diff --git a/pkg/web_components/lib/dart_support.js b/pkg/web_components/lib/dart_support.js
index 2f9e1af6ffb6120f780a3c278927cf191869655c..44b5a38cad1912c75ad8e8b5be586d05e845aa86 100644
--- a/pkg/web_components/lib/dart_support.js
+++ b/pkg/web_components/lib/dart_support.js
@@ -6,6 +6,12 @@
var ShadowDOMPolyfill = window.ShadowDOMPolyfill;
if (!ShadowDOMPolyfill) return;
+ if (navigator.userAgent.indexOf('(Dart)') !== -1) {
+ console.error("ShadowDOMPolyfill polyfill was loaded in Dartium. This " +
+ "will not work. This indicates that Dartium's Chrome version is " +
+ "not compatible with this version of web_components.");
+ }
+
var needsConstructorFix = window.constructor === window.Window;
// TODO(jmesserly): we need to wrap document somehow (a dart:html hook?)
@@ -30,7 +36,7 @@
if (obj instanceof HTMLTemplateElement) return 'HTMLTemplateElement';
var unwrapped = unwrapIfNeeded(obj);
- if (needsConstructorFix || obj !== unwrapped) {
+ if (unwrapped && (needsConstructorFix || obj !== unwrapped)) {
// Fix up class names for Firefox, or if using the minified polyfill.
// dart2js prefers .constructor.name, but there are all kinds of cases
// where this will give the wrong answer.
« no previous file with comments | « pkg/web_components/lib/build.log ('k') | pkg/web_components/lib/platform.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698