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 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 } | 24 } |
25 return s; | 25 return s; |
26 } | 26 } |
27 | 27 |
28 void writeClasses(Set s) { | 28 void writeClasses(Set s) { |
29 List list = new List.from(s); | 29 List list = new List.from(s); |
30 _element.attributes['class'] = Strings.join(list, ' '); | 30 _element.attributes['class'] = Strings.join(list, ' '); |
31 } | 31 } |
32 } | 32 } |
33 | 33 $ANNOTATIONS |
34 /// @domName $DOMNAME | |
35 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 34 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
36 factory $CLASSNAME.tag(String tag) => | 35 factory $CLASSNAME.tag(String tag) => |
37 _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_tag(tag); | 36 _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_tag(tag); |
38 factory $CLASSNAME.svg(String svg) => | 37 factory $CLASSNAME.svg(String svg) => |
39 _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_svg(svg); | 38 _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_svg(svg); |
40 | 39 |
41 _AttributeClassSet _cssClassSet; | 40 _AttributeClassSet _cssClassSet; |
42 CssClassSet get classes { | 41 CssClassSet get classes { |
43 if (_cssClassSet == null) { | 42 if (_cssClassSet == null) { |
44 _cssClassSet = new _AttributeClassSet(this); | 43 _cssClassSet = new _AttributeClassSet(this); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void set innerHtml(String svg) { | 80 void set innerHtml(String svg) { |
82 final container = new Element.tag("div"); | 81 final container = new Element.tag("div"); |
83 // Wrap the SVG string in <svg> so that SvgElements are created, rather than | 82 // Wrap the SVG string in <svg> so that SvgElements are created, rather than |
84 // HTMLElements. | 83 // HTMLElements. |
85 container.innerHtml = '<svg version="1.1">$svg</svg>'; | 84 container.innerHtml = '<svg version="1.1">$svg</svg>'; |
86 this.children = container.children[0].children; | 85 this.children = container.children[0].children; |
87 } | 86 } |
88 | 87 |
89 // Unsupported methods inherited from Element. | 88 // Unsupported methods inherited from Element. |
90 | 89 |
91 /** @domName Element.insertAdjacentText */ | 90 @DomName('Element.insertAdjacentText') |
92 void insertAdjacentText(String where, String text) { | 91 void insertAdjacentText(String where, String text) { |
93 throw new UnsupportedError("Cannot invoke insertAdjacentText on SVG."); | 92 throw new UnsupportedError("Cannot invoke insertAdjacentText on SVG."); |
94 } | 93 } |
95 | 94 |
96 /** @domName Element.insertAdjacentHTML */ | 95 @DomName('Element.insertAdjacentHTML') |
97 void insertAdjacentHtml(String where, String text) { | 96 void insertAdjacentHtml(String where, String text) { |
98 throw new UnsupportedError("Cannot invoke insertAdjacentHtml on SVG."); | 97 throw new UnsupportedError("Cannot invoke insertAdjacentHtml on SVG."); |
99 } | 98 } |
100 | 99 |
101 /** @domName Element.insertAdjacentHTML */ | 100 @DomName('Element.insertAdjacentHTML') |
102 Element insertAdjacentElement(String where, Element element) { | 101 Element insertAdjacentElement(String where, Element element) { |
103 throw new UnsupportedError("Cannot invoke insertAdjacentElement on SVG."); | 102 throw new UnsupportedError("Cannot invoke insertAdjacentElement on SVG."); |
104 } | 103 } |
105 | 104 |
106 HtmlCollection get $dom_children { | 105 HtmlCollection get $dom_children { |
107 throw new UnsupportedError("Cannot get dom_children on SVG."); | 106 throw new UnsupportedError("Cannot get dom_children on SVG."); |
108 } | 107 } |
109 | 108 |
110 bool get isContentEditable => false; | 109 bool get isContentEditable => false; |
111 void click() { | 110 void click() { |
112 throw new UnsupportedError("Cannot invoke click SVG."); | 111 throw new UnsupportedError("Cannot invoke click SVG."); |
113 } | 112 } |
114 | 113 |
115 $!MEMBERS | 114 $!MEMBERS |
116 } | 115 } |
OLD | NEW |