Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 if (navigator.dartEnabled || (navigator.userAgent.indexOf('(Dart)') !== -1)) { |
|
kasperl
2014/08/13 07:29:33
Same question.
| |
| 11 console.error("ShadowDOMPolyfill polyfill was loaded in Dartium. This " + | 11 console.error("ShadowDOMPolyfill polyfill was loaded in Dartium. This " + |
| 12 "will not work. This indicates that Dartium's Chrome version is " + | 12 "will not work. This indicates that Dartium's Chrome version is " + |
| 13 "not compatible with this version of web_components."); | 13 "not compatible with this version of web_components."); |
| 14 } | 14 } |
| 15 | 15 |
| 16 var needsConstructorFix = window.constructor === window.Window; | 16 var needsConstructorFix = window.constructor === window.Window; |
| 17 | 17 |
| 18 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) | 18 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) |
| 19 | 19 |
| 20 // dartNativeDispatchHooksTransformer is described on initHooks() in | 20 // dartNativeDispatchHooksTransformer is described on initHooks() in |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 return originalGetUnknownTag(o, tag); | 177 return originalGetUnknownTag(o, tag); |
| 178 } | 178 } |
| 179 }; | 179 }; |
| 180 }); | 180 }); |
| 181 } | 181 } |
| 182 | 182 |
| 183 doc._registerDartTypeUpgrader = registerDartTypeUpgrader; | 183 doc._registerDartTypeUpgrader = registerDartTypeUpgrader; |
| 184 doc._onlyUpgradeNewElements = onlyUpgradeNewElements; | 184 doc._onlyUpgradeNewElements = onlyUpgradeNewElements; |
| 185 doc.registerElement = registerElement; | 185 doc.registerElement = registerElement; |
| 186 })(document); | 186 })(document); |
| OLD | NEW |