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

Side by Side Diff: pkg/custom_element/lib/polyfill.dart

Issue 153063003: regenerate fixed custom_elements polyfill (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: update pubspec, revision info Created 6 years, 10 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/custom_element/lib/custom-elements.min.js ('k') | pkg/custom_element/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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** Dart APIs for interacting with the JavaScript Custom Elements polyfill. */ 5 /** Dart APIs for interacting with the JavaScript Custom Elements polyfill. */
6 library custom_element.polyfill; 6 library custom_element.polyfill;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:html'; 9 import 'dart:html';
10 import 'dart:js' as js; 10 import 'dart:js' as js;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 * Loads `custom-elements.debug.js` or `custom-elements.min.js` by adding the 47 * Loads `custom-elements.debug.js` or `custom-elements.min.js` by adding the
48 * script tag to the page. Returns a future that completes when custom elements 48 * script tag to the page. Returns a future that completes when custom elements
49 * are ready (equivalent to [customElementsReady]). 49 * are ready (equivalent to [customElementsReady]).
50 * 50 *
51 * Normally you should add this to your HTML file 51 * Normally you should add this to your HTML file
52 * (the Polymer package will do this automatically), but loading dynamically 52 * (the Polymer package will do this automatically), but loading dynamically
53 * can be useful for scenarios such as tests. 53 * can be useful for scenarios such as tests.
54 */ 54 */
55 Future loadCustomElementPolyfill() { 55 Future loadCustomElementPolyfill() {
56 if (!document.supportsRegister && !js.context.hasProperty('CustomElements')) { 56 if (!document.supportsRegister && !js.context.hasProperty('CustomElements')) {
57 if (!MutationObserver.supported) {
58 var script = new ScriptElement()
59 ..src = '/packages/mutation_observer/mutation_observer.js';
60 document.head.append(script);
61 }
62
63 var script = new ScriptElement() 57 var script = new ScriptElement()
64 ..src = '/packages/custom_element/custom-elements.debug.js'; 58 ..src = '/packages/custom_element/custom-elements.debug.js';
65 document.head.append(script); 59 document.head.append(script);
66 return document.on['WebComponentsReady'].first; 60 return document.on['WebComponentsReady'].first;
67 } 61 }
68 return new Future.value(); 62 return new Future.value();
69 } 63 }
OLDNEW
« no previous file with comments | « pkg/custom_element/lib/custom-elements.min.js ('k') | pkg/custom_element/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698