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