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

Side by Side Diff: samples/webcomponents/shadow_polyfill.dart

Issue 10854191: Require two type arguments for map literals (issue 4522). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « samples/markdown/lib.dart ('k') | tests/co19/co19-runtime.status » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Polyfill script for custom elements. To use this script, your app must 6 * Polyfill script for custom elements. To use this script, your app must
7 * create a CustomElementsManager with the appropriate lookup function before 7 * create a CustomElementsManager with the appropriate lookup function before
8 * doing any DOM queries or modifications. 8 * doing any DOM queries or modifications.
9 * Currently, all custom elements must be registered with the polyfill. To 9 * Currently, all custom elements must be registered with the polyfill. To
10 * register custom elements, provide the appropriate lookup function to your 10 * register custom elements, provide the appropriate lookup function to your
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // arbitrary Dart objects directly on DOM objects rather than this map. 67 // arbitrary Dart objects directly on DOM objects rather than this map.
68 /** Maps DOM elements to the user-defiend corresponding dart objects. */ 68 /** Maps DOM elements to the user-defiend corresponding dart objects. */
69 ListMap<Element, WebComponent> _customElements; 69 ListMap<Element, WebComponent> _customElements;
70 70
71 RegistryLookupFunction _lookup; 71 RegistryLookupFunction _lookup;
72 72
73 MutationObserver _insertionObserver; 73 MutationObserver _insertionObserver;
74 74
75 CustomElementsManager._internal(this._lookup) { 75 CustomElementsManager._internal(this._lookup) {
76 // TODO(samhop): check for ShadowDOM support 76 // TODO(samhop): check for ShadowDOM support
77 _customDeclarations = <_CustomDeclaration>{}; 77 _customDeclarations = <String, _CustomDeclaration>{};
78 // We use a ListMap because DOM objects aren't hashable right now. 78 // We use a ListMap because DOM objects aren't hashable right now.
79 // TODO(samhop): DOM objects (and everything else) should be hashable 79 // TODO(samhop): DOM objects (and everything else) should be hashable
80 _customElements = new ListMap<Element, WebComponent>(); 80 _customElements = new ListMap<Element, WebComponent>();
81 initializeInsertedRemovedCallbacks(document); 81 initializeInsertedRemovedCallbacks(document);
82 } 82 }
83 83
84 /** 84 /**
85 * Locate all external component files, load each of them, and expand 85 * Locate all external component files, load each of them, and expand
86 * declarations. 86 * declarations.
87 */ 87 */
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 }); 339 });
340 attributeObserver.observe(e, attributes: true, attributeOldValue: true); 340 attributeObserver.observe(e, attributes: true, attributeOldValue: true);
341 341
342 // Listen for all insertions and deletions on the DOM so that we can 342 // Listen for all insertions and deletions on the DOM so that we can
343 // catch custom elements being inserted and call the appropriate callbacks. 343 // catch custom elements being inserted and call the appropriate callbacks.
344 manager.initializeInsertedRemovedCallbacks(shadowRoot); 344 manager.initializeInsertedRemovedCallbacks(shadowRoot);
345 return newCustomElement; 345 return newCustomElement;
346 } 346 }
347 } 347 }
OLDNEW
« no previous file with comments | « samples/markdown/lib.dart ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698