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, |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 void set children(List<Element> value) { | 38 void set children(List<Element> value) { |
39 // Copy list first since we don't want liveness during iteration. | 39 // Copy list first since we don't want liveness during iteration. |
40 List copy = new List.from(value); | 40 List copy = new List.from(value); |
41 var children = this.children; | 41 var children = this.children; |
42 children.clear(); | 42 children.clear(); |
43 children.addAll(copy); | 43 children.addAll(copy); |
44 } | 44 } |
45 | 45 |
46 Element query(String selectors) => _querySelector(selectors); | 46 ElementList querySelectorAll(String selectors) => |
| 47 new _FrozenElementList._wrap(_querySelectorAll(selectors)); |
47 | 48 |
48 List<Element> queryAll(String selectors) => | 49 |
49 new _FrozenElementList._wrap(_querySelectorAll(selectors)); | |
50 | 50 |
51 String get innerHtml { | 51 String get innerHtml { |
52 final e = new Element.tag("div"); | 52 final e = new Element.tag("div"); |
53 e.append(this.clone(true)); | 53 e.append(this.clone(true)); |
54 return e.innerHtml; | 54 return e.innerHtml; |
55 } | 55 } |
56 | 56 |
57 void set innerHtml(String value) { | 57 void set innerHtml(String value) { |
58 this.setInnerHtml(value); | 58 this.setInnerHtml(value); |
59 } | 59 } |
(...skipping 16 matching lines...) Expand all Loading... |
76 | 76 |
77 | 77 |
78 /** | 78 /** |
79 * Parses the specified text as HTML and adds the resulting node after the | 79 * Parses the specified text as HTML and adds the resulting node after the |
80 * last child of this document fragment. | 80 * last child of this document fragment. |
81 */ | 81 */ |
82 void appendHtml(String text) { | 82 void appendHtml(String text) { |
83 this.append(new DocumentFragment.html(text)); | 83 this.append(new DocumentFragment.html(text)); |
84 } | 84 } |
85 | 85 |
| 86 /** |
| 87 * Alias for [querySelector]. Note this function is deprecated because its |
| 88 * semantics will be changing in the future. |
| 89 */ |
| 90 @deprecated |
| 91 @Experimental() |
| 92 @DomName('DocumentFragment.querySelector') |
| 93 Element query(String relativeSelectors) { |
| 94 return querySelector(relativeSelectors); |
| 95 } |
| 96 |
| 97 /** |
| 98 * Alias for [querySelectorAll]. Note this function is deprecated because its |
| 99 * semantics will be changing in the future. |
| 100 */ |
| 101 @deprecated |
| 102 @Experimental() |
| 103 @DomName('DocumentFragment.querySelectorAll') |
| 104 ElementList queryAll(String relativeSelectors) { |
| 105 return querySelectorAll(relativeSelectors); |
| 106 } |
86 $!MEMBERS | 107 $!MEMBERS |
87 } | 108 } |
OLD | NEW |