| OLD | NEW |
| 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 8562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8573 DocumentFragment get content { | 8573 DocumentFragment get content { |
| 8574 _ensureTemplate(); | 8574 _ensureTemplate(); |
| 8575 return _templateContent; | 8575 return _templateContent; |
| 8576 } | 8576 } |
| 8577 | 8577 |
| 8578 /** | 8578 /** |
| 8579 * Creates an instance of the template. | 8579 * Creates an instance of the template. |
| 8580 * This is only supported if [isTemplate] is true. | 8580 * This is only supported if [isTemplate] is true. |
| 8581 */ | 8581 */ |
| 8582 @Experimental() | 8582 @Experimental() |
| 8583 DocumentFragment createInstance() { | 8583 DocumentFragment createInstance(model, String syntax) { |
| 8584 _ensureTemplate(); | 8584 _ensureTemplate(); |
| 8585 return TemplateElement.mdvPackage(this).createInstance(); | 8585 return TemplateElement.mdvPackage(this).createInstance(model, syntax); |
| 8586 } | 8586 } |
| 8587 | 8587 |
| 8588 /** | 8588 /** |
| 8589 * The data model which is inherited through the tree. | 8589 * The data model which is inherited through the tree. |
| 8590 * This is only supported if [isTemplate] is true. | 8590 * This is only supported if [isTemplate] is true. |
| 8591 */ | 8591 */ |
| 8592 @Experimental() | 8592 @Experimental() |
| 8593 get model => TemplateElement.mdvPackage(this).model; | 8593 get model => TemplateElement.mdvPackage(this).model; |
| 8594 | 8594 |
| 8595 @Experimental() | 8595 @Experimental() |
| (...skipping 12717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21313 | 21313 |
| 21314 @DomName('HTMLTableSectionElement.deleteRow') | 21314 @DomName('HTMLTableSectionElement.deleteRow') |
| 21315 @DocsEditable() | 21315 @DocsEditable() |
| 21316 void deleteRow(int index) native; | 21316 void deleteRow(int index) native; |
| 21317 | 21317 |
| 21318 @JSName('insertRow') | 21318 @JSName('insertRow') |
| 21319 @DomName('HTMLTableSectionElement.insertRow') | 21319 @DomName('HTMLTableSectionElement.insertRow') |
| 21320 @DocsEditable() | 21320 @DocsEditable() |
| 21321 Element $dom_insertRow(int index) native; | 21321 Element $dom_insertRow(int index) native; |
| 21322 } | 21322 } |
| 21323 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 21323 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 21324 // for details. All rights reserved. Use of this source code is governed by a | 21324 // for details. All rights reserved. Use of this source code is governed by a |
| 21325 // BSD-style license that can be found in the LICENSE file. | 21325 // BSD-style license that can be found in the LICENSE file. |
| 21326 | 21326 |
| 21327 // WARNING: Do not edit - generated code. | 21327 // WARNING: Do not edit - generated code. |
| 21328 | 21328 |
| 21329 | 21329 |
| 21330 | 21330 |
| 21331 /** | 21331 /** |
| 21332 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases, | 21332 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases, |
| 21333 * but (by design) don't attempt to implement a wide array of specialized | 21333 * 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 Loading... |
| 21401 * | 21401 * |
| 21402 * - [template]: The template element which is about to create and insert an | 21402 * - [template]: The template element which is about to create and insert an |
| 21403 * instance. | 21403 * instance. |
| 21404 * - [model]: The data context for which this instance is being created. | 21404 * - [model]: The data context for which this instance is being created. |
| 21405 * | 21405 * |
| 21406 * The template element will always use the return value of `getInstanceModel` | 21406 * The template element will always use the return value of `getInstanceModel` |
| 21407 * as the model for the new instance. If the syntax does not wish to override | 21407 * as the model for the new instance. If the syntax does not wish to override |
| 21408 * the value, it should simply return the `model` value it was passed. | 21408 * the value, it should simply return the `model` value it was passed. |
| 21409 */ | 21409 */ |
| 21410 getInstanceModel(Element template, model) => model; | 21410 getInstanceModel(Element template, model) => model; |
| 21411 | |
| 21412 /** | |
| 21413 * This syntax method allows a syntax to provide an alterate expansion of | |
| 21414 * the [template] contents. When the template wants to create an instance, | |
| 21415 * it will call this method with the template element. | |
| 21416 * | |
| 21417 * By default this will call `template.createInstance()`. | |
| 21418 */ | |
| 21419 getInstanceFragment(Element template) => template.createInstance(); | |
| 21420 } | 21411 } |
| 21421 | 21412 |
| 21422 | 21413 |
| 21423 @Experimental() | 21414 @Experimental() |
| 21424 @DomName('HTMLTemplateElement') | 21415 @DomName('HTMLTemplateElement') |
| 21425 @SupportedBrowser(SupportedBrowser.CHROME) | 21416 @SupportedBrowser(SupportedBrowser.CHROME) |
| 21426 @Experimental() | 21417 @Experimental() |
| 21427 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#t
emplate-element | 21418 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#t
emplate-element |
| 21428 class TemplateElement extends _HTMLElement native "HTMLTemplateElement" { | 21419 class TemplateElement extends _HTMLElement native "HTMLTemplateElement" { |
| 21429 // To suppress missing implicit constructor warnings. | 21420 // To suppress missing implicit constructor warnings. |
| (...skipping 7902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 29332 _position = nextPosition; | 29323 _position = nextPosition; |
| 29333 return true; | 29324 return true; |
| 29334 } | 29325 } |
| 29335 _current = null; | 29326 _current = null; |
| 29336 _position = _array.length; | 29327 _position = _array.length; |
| 29337 return false; | 29328 return false; |
| 29338 } | 29329 } |
| 29339 | 29330 |
| 29340 T get current => _current; | 29331 T get current => _current; |
| 29341 } | 29332 } |
| OLD | NEW |