| OLD | NEW |
| 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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 8 factory $CLASSNAME() => document.createDocumentFragment(); | 8 factory $CLASSNAME() => document.createDocumentFragment(); |
| 9 | 9 |
| 10 factory $CLASSNAME.html(String html, | 10 factory $CLASSNAME.html(String html, |
| 11 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { | 11 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { |
| 12 | 12 |
| 13 return document.body.createFragment(html, | 13 return document.body.createFragment(html, |
| 14 validator: validator, treeSanitizer: treeSanitizer); | 14 validator: validator, treeSanitizer: treeSanitizer); |
| 15 } | 15 } |
| 16 | 16 |
| 17 factory $CLASSNAME.svg(String svgContent, | 17 factory $CLASSNAME.svg(String svgContent, |
| 18 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { | 18 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { |
| 19 | 19 |
| 20 return new svg.SvgSvgElement().createFragment(svgContent, | 20 return new svg.SvgSvgElement().createFragment(svgContent, |
| 21 validator: validator, treeSanitizer: treeSanitizer); | 21 validator: validator, treeSanitizer: treeSanitizer); |
| 22 } | 22 } |
| 23 | 23 |
| 24 HtmlCollection get _children => throw new UnimplementedError( |
| 25 'Use _docChildren instead'); |
| 26 |
| 24 $if DART2JS | 27 $if DART2JS |
| 25 // Native field is used only by Dart code so does not lead to instantiation | 28 // Native field is used only by Dart code so does not lead to instantiation |
| 26 // of native classes | 29 // of native classes |
| 27 @Creates('Null') | 30 @Creates('Null') |
| 28 $endif | 31 $endif |
| 29 List<Element> _children; | 32 List<Element> _docChildren; |
| 30 | 33 |
| 31 List<Element> get children { | 34 List<Element> get children { |
| 32 if (_children == null) { | 35 if (_docChildren == null) { |
| 33 _children = new FilteredElementList(this); | 36 _docChildren = new FilteredElementList(this); |
| 34 } | 37 } |
| 35 return _children; | 38 return _docChildren; |
| 36 } | 39 } |
| 37 | 40 |
| 38 void set children(List<Element> value) { | 41 void set children(List<Element> value) { |
| 39 // Copy list first since we don't want liveness during iteration. | 42 // Copy list first since we don't want liveness during iteration. |
| 40 List copy = new List.from(value); | 43 List copy = new List.from(value); |
| 41 var children = this.children; | 44 var children = this.children; |
| 42 children.clear(); | 45 children.clear(); |
| 43 children.addAll(copy); | 46 children.addAll(copy); |
| 44 } | 47 } |
| 45 | 48 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 * semantics will be changing in the future. | 113 * semantics will be changing in the future. |
| 111 */ | 114 */ |
| 112 @deprecated | 115 @deprecated |
| 113 @Experimental() | 116 @Experimental() |
| 114 @DomName('DocumentFragment.querySelectorAll') | 117 @DomName('DocumentFragment.querySelectorAll') |
| 115 ElementList queryAll(String relativeSelectors) { | 118 ElementList queryAll(String relativeSelectors) { |
| 116 return querySelectorAll(relativeSelectors); | 119 return querySelectorAll(relativeSelectors); |
| 117 } | 120 } |
| 118 $!MEMBERS | 121 $!MEMBERS |
| 119 } | 122 } |
| OLD | NEW |