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

Side by Side Diff: pkg/web_components/lib/dart_support.js

Issue 462333002: Change how we check for user agent, in preparation for breaking change in Dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/web_components/CHANGELOG.md ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Teaches dart2js about the wrapping that is done by the Shadow DOM polyfill. 5 // Teaches dart2js about the wrapping that is done by the Shadow DOM polyfill.
6 (function() { 6 (function() {
7 var ShadowDOMPolyfill = window.ShadowDOMPolyfill; 7 var ShadowDOMPolyfill = window.ShadowDOMPolyfill;
8 if (!ShadowDOMPolyfill) return; 8 if (!ShadowDOMPolyfill) return;
9 9
10 if (navigator.userAgent.indexOf('(Dart)') !== -1) { 10 // TODO(sigmund): remove the userAgent check once 1.6 rolls as stable.
11 // See: dartbug.com/18463
12 if (navigator.dartEnabled || (navigator.userAgent.indexOf('(Dart)') !== -1)) {
11 console.error("ShadowDOMPolyfill polyfill was loaded in Dartium. This " + 13 console.error("ShadowDOMPolyfill polyfill was loaded in Dartium. This " +
12 "will not work. This indicates that Dartium's Chrome version is " + 14 "will not work. This indicates that Dartium's Chrome version is " +
13 "not compatible with this version of web_components."); 15 "not compatible with this version of web_components.");
14 } 16 }
15 17
16 var needsConstructorFix = window.constructor === window.Window; 18 var needsConstructorFix = window.constructor === window.Window;
17 19
18 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) 20 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?)
19 21
20 // dartNativeDispatchHooksTransformer is described on initHooks() in 22 // dartNativeDispatchHooksTransformer is described on initHooks() in
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return originalGetUnknownTag(o, tag); 179 return originalGetUnknownTag(o, tag);
178 } 180 }
179 }; 181 };
180 }); 182 });
181 } 183 }
182 184
183 doc._registerDartTypeUpgrader = registerDartTypeUpgrader; 185 doc._registerDartTypeUpgrader = registerDartTypeUpgrader;
184 doc._onlyUpgradeNewElements = onlyUpgradeNewElements; 186 doc._onlyUpgradeNewElements = onlyUpgradeNewElements;
185 doc.registerElement = registerElement; 187 doc.registerElement = registerElement;
186 })(document); 188 })(document);
OLDNEW
« no previous file with comments | « pkg/web_components/CHANGELOG.md ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698