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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 18162004: [package:mdv] port createInstance change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix copyright line Created 7 years, 5 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
OLDNEW
1 /// The Dart HTML library. 1 /// The Dart HTML library.
2 /// 2 ///
3 /// For examples, see 3 /// For examples, see
4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) 4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples)
5 /// on Github. 5 /// on Github.
6 library dart.dom.html; 6 library dart.dom.html;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:_collection-dev' hide Symbol; 10 import 'dart:_collection-dev' hide Symbol;
(...skipping 8315 matching lines...) Expand 10 before | Expand all | Expand 10 after
8326 DocumentFragment get content { 8326 DocumentFragment get content {
8327 _ensureTemplate(); 8327 _ensureTemplate();
8328 return _templateContent; 8328 return _templateContent;
8329 } 8329 }
8330 8330
8331 /** 8331 /**
8332 * Creates an instance of the template. 8332 * Creates an instance of the template.
8333 * This is only supported if [isTemplate] is true. 8333 * This is only supported if [isTemplate] is true.
8334 */ 8334 */
8335 @Experimental 8335 @Experimental
8336 DocumentFragment createInstance() { 8336 DocumentFragment createInstance(model, String syntax) {
8337 _ensureTemplate(); 8337 _ensureTemplate();
8338 return TemplateElement.mdvPackage(this).createInstance(); 8338 return TemplateElement.mdvPackage(this).createInstance(model, syntax);
8339 } 8339 }
8340 8340
8341 /** 8341 /**
8342 * The data model which is inherited through the tree. 8342 * The data model which is inherited through the tree.
8343 * This is only supported if [isTemplate] is true. 8343 * This is only supported if [isTemplate] is true.
8344 */ 8344 */
8345 @Experimental 8345 @Experimental
8346 get model => TemplateElement.mdvPackage(this).model; 8346 get model => TemplateElement.mdvPackage(this).model;
8347 8347
8348 @Experimental 8348 @Experimental
(...skipping 12496 matching lines...) Expand 10 before | Expand all | Expand 10 after
20845 20845
20846 @DomName('HTMLTableSectionElement.deleteRow') 20846 @DomName('HTMLTableSectionElement.deleteRow')
20847 @DocsEditable 20847 @DocsEditable
20848 void deleteRow(int index) native; 20848 void deleteRow(int index) native;
20849 20849
20850 @JSName('insertRow') 20850 @JSName('insertRow')
20851 @DomName('HTMLTableSectionElement.insertRow') 20851 @DomName('HTMLTableSectionElement.insertRow')
20852 @DocsEditable 20852 @DocsEditable
20853 Element $dom_insertRow(int index) native; 20853 Element $dom_insertRow(int index) native;
20854 } 20854 }
20855 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 20855 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
20856 // for details. All rights reserved. Use of this source code is governed by a 20856 // for details. All rights reserved. Use of this source code is governed by a
20857 // BSD-style license that can be found in the LICENSE file. 20857 // BSD-style license that can be found in the LICENSE file.
20858 20858
20859 // WARNING: Do not edit - generated code. 20859 // WARNING: Do not edit - generated code.
20860 20860
20861 20861
20862 20862
20863 /** 20863 /**
20864 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases, 20864 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases,
20865 * but (by design) don't attempt to implement a wide array of specialized 20865 * but (by design) don't attempt to implement a wide array of specialized
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
20933 * 20933 *
20934 * - [template]: The template element which is about to create and insert an 20934 * - [template]: The template element which is about to create and insert an
20935 * instance. 20935 * instance.
20936 * - [model]: The data context for which this instance is being created. 20936 * - [model]: The data context for which this instance is being created.
20937 * 20937 *
20938 * The template element will always use the return value of `getInstanceModel` 20938 * The template element will always use the return value of `getInstanceModel`
20939 * as the model for the new instance. If the syntax does not wish to override 20939 * as the model for the new instance. If the syntax does not wish to override
20940 * the value, it should simply return the `model` value it was passed. 20940 * the value, it should simply return the `model` value it was passed.
20941 */ 20941 */
20942 getInstanceModel(Element template, model) => model; 20942 getInstanceModel(Element template, model) => model;
20943
20944 /**
20945 * This syntax method allows a syntax to provide an alterate expansion of
20946 * the [template] contents. When the template wants to create an instance,
20947 * it will call this method with the template element.
20948 *
20949 * By default this will call `template.createInstance()`.
20950 */
20951 getInstanceFragment(Element template) => template.createInstance();
20952 } 20943 }
20953 20944
20954 20945
20955 @Experimental 20946 @Experimental
20956 @DomName('HTMLTemplateElement') 20947 @DomName('HTMLTemplateElement')
20957 @SupportedBrowser(SupportedBrowser.CHROME) 20948 @SupportedBrowser(SupportedBrowser.CHROME)
20958 @Experimental 20949 @Experimental
20959 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#t emplate-element 20950 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#t emplate-element
20960 class TemplateElement extends _HTMLElement native "HTMLTemplateElement" { 20951 class TemplateElement extends _HTMLElement native "HTMLTemplateElement" {
20961 20952
(...skipping 7829 matching lines...) Expand 10 before | Expand all | Expand 10 after
28791 _position = nextPosition; 28782 _position = nextPosition;
28792 return true; 28783 return true;
28793 } 28784 }
28794 _current = null; 28785 _current = null;
28795 _position = _array.length; 28786 _position = _array.length;
28796 return false; 28787 return false;
28797 } 28788 }
28798 28789
28799 T get current => _current; 28790 T get current => _current;
28800 } 28791 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698