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 svg; | 5 part of svg; |
6 | 6 |
7 class _AttributeClassSet extends CssClassSet { | 7 class _AttributeClassSet extends CssClassSet { |
8 final Element _element; | 8 final Element _element; |
9 | 9 |
10 _AttributeClassSet(this._element); | 10 _AttributeClassSet(this._element); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 List<Element> get elements => new FilteredElementList(this); | 48 List<Element> get elements => new FilteredElementList(this); |
49 | 49 |
50 void set elements(Collection<Element> value) { | 50 void set elements(Collection<Element> value) { |
51 final elements = this.elements; | 51 final elements = this.elements; |
52 elements.clear(); | 52 elements.clear(); |
53 elements.addAll(value); | 53 elements.addAll(value); |
54 } | 54 } |
55 | 55 |
| 56 List<Element> get children => new FilteredElementList(this); |
| 57 |
| 58 void set children(Collection<Element> value) { |
| 59 final children = this.children; |
| 60 children.clear(); |
| 61 children.addAll(value); |
| 62 } |
| 63 |
56 String get outerHTML { | 64 String get outerHTML { |
57 final container = new Element.tag("div"); | 65 final container = new Element.tag("div"); |
58 final SVGElement cloned = this.clone(true); | 66 final SVGElement cloned = this.clone(true); |
59 container.elements.add(cloned); | 67 container.children.add(cloned); |
60 return container.innerHTML; | 68 return container.innerHTML; |
61 } | 69 } |
62 | 70 |
63 String get innerHTML { | 71 String get innerHTML { |
64 final container = new Element.tag("div"); | 72 final container = new Element.tag("div"); |
65 final SVGElement cloned = this.clone(true); | 73 final SVGElement cloned = this.clone(true); |
66 container.elements.addAll(cloned.elements); | 74 container.children.addAll(cloned.children); |
67 return container.innerHTML; | 75 return container.innerHTML; |
68 } | 76 } |
69 | 77 |
70 void set innerHTML(String svg) { | 78 void set innerHTML(String svg) { |
71 final container = new Element.tag("div"); | 79 final container = new Element.tag("div"); |
72 // Wrap the SVG string in <svg> so that SVGElements are created, rather than | 80 // Wrap the SVG string in <svg> so that SVGElements are created, rather than |
73 // HTMLElements. | 81 // HTMLElements. |
74 container.innerHTML = '<svg version="1.1">$svg</svg>'; | 82 container.innerHTML = '<svg version="1.1">$svg</svg>'; |
75 this.elements = container.elements[0].elements; | 83 this.children = container.children[0].children; |
76 } | 84 } |
77 | 85 |
78 $!MEMBERS | 86 $!MEMBERS |
79 } | 87 } |
OLD | NEW |