OLD | NEW |
1 /** | 1 /** |
2 * Scalable Vector Graphics: | 2 * Scalable Vector Graphics: |
3 * Two-dimensional vector graphics with support for events and animation. | 3 * Two-dimensional vector graphics with support for events and animation. |
4 * | 4 * |
5 * For details about the features and syntax of SVG, a W3C standard, | 5 * For details about the features and syntax of SVG, a W3C standard, |
6 * refer to the | 6 * refer to the |
7 * [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/). | 7 * [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/). |
8 */ | 8 */ |
9 library dart.dom.svg; | 9 library dart.dom.svg; |
10 | 10 |
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2686 throw new RangeError.index(index, this); | 2686 throw new RangeError.index(index, this); |
2687 return this.getItem(index); | 2687 return this.getItem(index); |
2688 } | 2688 } |
2689 void operator[]=(int index, Length value) { | 2689 void operator[]=(int index, Length value) { |
2690 throw new UnsupportedError("Cannot assign element of immutable List."); | 2690 throw new UnsupportedError("Cannot assign element of immutable List."); |
2691 } | 2691 } |
2692 // -- start List<Length> mixins. | 2692 // -- start List<Length> mixins. |
2693 // Length is the element type. | 2693 // Length is the element type. |
2694 | 2694 |
2695 | 2695 |
2696 set length(int value) { | 2696 void set length(int value) { |
2697 throw new UnsupportedError("Cannot resize immutable List."); | 2697 throw new UnsupportedError("Cannot resize immutable List."); |
2698 } | 2698 } |
2699 | 2699 |
2700 Length get first { | 2700 Length get first { |
2701 if (this.length > 0) { | 2701 if (this.length > 0) { |
2702 return JS('Length', '#[0]', this); | 2702 return JS('Length', '#[0]', this); |
2703 } | 2703 } |
2704 throw new StateError("No elements"); | 2704 throw new StateError("No elements"); |
2705 } | 2705 } |
2706 | 2706 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 throw new RangeError.index(index, this); | 3138 throw new RangeError.index(index, this); |
3139 return this.getItem(index); | 3139 return this.getItem(index); |
3140 } | 3140 } |
3141 void operator[]=(int index, Number value) { | 3141 void operator[]=(int index, Number value) { |
3142 throw new UnsupportedError("Cannot assign element of immutable List."); | 3142 throw new UnsupportedError("Cannot assign element of immutable List."); |
3143 } | 3143 } |
3144 // -- start List<Number> mixins. | 3144 // -- start List<Number> mixins. |
3145 // Number is the element type. | 3145 // Number is the element type. |
3146 | 3146 |
3147 | 3147 |
3148 set length(int value) { | 3148 void set length(int value) { |
3149 throw new UnsupportedError("Cannot resize immutable List."); | 3149 throw new UnsupportedError("Cannot resize immutable List."); |
3150 } | 3150 } |
3151 | 3151 |
3152 Number get first { | 3152 Number get first { |
3153 if (this.length > 0) { | 3153 if (this.length > 0) { |
3154 return JS('Number', '#[0]', this); | 3154 return JS('Number', '#[0]', this); |
3155 } | 3155 } |
3156 throw new StateError("No elements"); | 3156 throw new StateError("No elements"); |
3157 } | 3157 } |
3158 | 3158 |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3925 throw new RangeError.index(index, this); | 3925 throw new RangeError.index(index, this); |
3926 return this.getItem(index); | 3926 return this.getItem(index); |
3927 } | 3927 } |
3928 void operator[]=(int index, PathSeg value) { | 3928 void operator[]=(int index, PathSeg value) { |
3929 throw new UnsupportedError("Cannot assign element of immutable List."); | 3929 throw new UnsupportedError("Cannot assign element of immutable List."); |
3930 } | 3930 } |
3931 // -- start List<PathSeg> mixins. | 3931 // -- start List<PathSeg> mixins. |
3932 // PathSeg is the element type. | 3932 // PathSeg is the element type. |
3933 | 3933 |
3934 | 3934 |
3935 set length(int value) { | 3935 void set length(int value) { |
3936 throw new UnsupportedError("Cannot resize immutable List."); | 3936 throw new UnsupportedError("Cannot resize immutable List."); |
3937 } | 3937 } |
3938 | 3938 |
3939 PathSeg get first { | 3939 PathSeg get first { |
3940 if (this.length > 0) { | 3940 if (this.length > 0) { |
3941 return JS('PathSeg', '#[0]', this); | 3941 return JS('PathSeg', '#[0]', this); |
3942 } | 3942 } |
3943 throw new StateError("No elements"); | 3943 throw new StateError("No elements"); |
3944 } | 3944 } |
3945 | 3945 |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4620 throw new RangeError.index(index, this); | 4620 throw new RangeError.index(index, this); |
4621 return this.getItem(index); | 4621 return this.getItem(index); |
4622 } | 4622 } |
4623 void operator[]=(int index, String value) { | 4623 void operator[]=(int index, String value) { |
4624 throw new UnsupportedError("Cannot assign element of immutable List."); | 4624 throw new UnsupportedError("Cannot assign element of immutable List."); |
4625 } | 4625 } |
4626 // -- start List<String> mixins. | 4626 // -- start List<String> mixins. |
4627 // String is the element type. | 4627 // String is the element type. |
4628 | 4628 |
4629 | 4629 |
4630 set length(int value) { | 4630 void set length(int value) { |
4631 throw new UnsupportedError("Cannot resize immutable List."); | 4631 throw new UnsupportedError("Cannot resize immutable List."); |
4632 } | 4632 } |
4633 | 4633 |
4634 String get first { | 4634 String get first { |
4635 if (this.length > 0) { | 4635 if (this.length > 0) { |
4636 return JS('String', '#[0]', this); | 4636 return JS('String', '#[0]', this); |
4637 } | 4637 } |
4638 throw new StateError("No elements"); | 4638 throw new StateError("No elements"); |
4639 } | 4639 } |
4640 | 4640 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4724 String media; | 4724 String media; |
4725 | 4725 |
4726 @DomName('SVGStyleElement.sheet') | 4726 @DomName('SVGStyleElement.sheet') |
4727 @DocsEditable() | 4727 @DocsEditable() |
4728 @Experimental() // untriaged | 4728 @Experimental() // untriaged |
4729 final StyleSheet sheet; | 4729 final StyleSheet sheet; |
4730 | 4730 |
4731 // Shadowing definition. | 4731 // Shadowing definition. |
4732 String get title => JS("String", "#.title", this); | 4732 String get title => JS("String", "#.title", this); |
4733 | 4733 |
4734 set title(String value) { | 4734 void set title(String value) { |
4735 JS("void", "#.title = #", this, value); | 4735 JS("void", "#.title = #", this, value); |
4736 } | 4736 } |
4737 | 4737 |
4738 @DomName('SVGStyleElement.type') | 4738 @DomName('SVGStyleElement.type') |
4739 @DocsEditable() | 4739 @DocsEditable() |
4740 String type; | 4740 String type; |
4741 } | 4741 } |
4742 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 4742 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4743 // for details. All rights reserved. Use of this source code is governed by a | 4743 // for details. All rights reserved. Use of this source code is governed by a |
4744 // BSD-style license that can be found in the LICENSE file. | 4744 // BSD-style license that can be found in the LICENSE file. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4794 } | 4794 } |
4795 var fragment = parentElement.createFragment(svg, validator: validator, | 4795 var fragment = parentElement.createFragment(svg, validator: validator, |
4796 treeSanitizer: treeSanitizer); | 4796 treeSanitizer: treeSanitizer); |
4797 return fragment.nodes.where((e) => e is SvgElement).single; | 4797 return fragment.nodes.where((e) => e is SvgElement).single; |
4798 } | 4798 } |
4799 | 4799 |
4800 CssClassSet get classes => new _AttributeClassSet(this); | 4800 CssClassSet get classes => new _AttributeClassSet(this); |
4801 | 4801 |
4802 List<Element> get children => new FilteredElementList(this); | 4802 List<Element> get children => new FilteredElementList(this); |
4803 | 4803 |
4804 set children(List<Element> value) { | 4804 void set children(List<Element> value) { |
4805 final children = this.children; | 4805 final children = this.children; |
4806 children.clear(); | 4806 children.clear(); |
4807 children.addAll(value); | 4807 children.addAll(value); |
4808 } | 4808 } |
4809 | 4809 |
4810 String get outerHtml { | 4810 String get outerHtml { |
4811 final container = new Element.tag("div"); | 4811 final container = new Element.tag("div"); |
4812 final SvgElement cloned = this.clone(true); | 4812 final SvgElement cloned = this.clone(true); |
4813 container.children.add(cloned); | 4813 container.children.add(cloned); |
4814 return container.innerHtml; | 4814 return container.innerHtml; |
4815 } | 4815 } |
4816 | 4816 |
4817 String get innerHtml { | 4817 String get innerHtml { |
4818 final container = new Element.tag("div"); | 4818 final container = new Element.tag("div"); |
4819 final SvgElement cloned = this.clone(true); | 4819 final SvgElement cloned = this.clone(true); |
4820 container.children.addAll(cloned.children); | 4820 container.children.addAll(cloned.children); |
4821 return container.innerHtml; | 4821 return container.innerHtml; |
4822 } | 4822 } |
4823 | 4823 |
4824 set innerHtml(String value) { | 4824 void set innerHtml(String value) { |
4825 this.setInnerHtml(value); | 4825 this.setInnerHtml(value); |
4826 } | 4826 } |
4827 | 4827 |
4828 DocumentFragment createFragment(String svg, | 4828 DocumentFragment createFragment(String svg, |
4829 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { | 4829 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { |
4830 | 4830 |
4831 if (treeSanitizer == null) { | 4831 if (treeSanitizer == null) { |
4832 if (validator == null) { | 4832 if (validator == null) { |
4833 validator = new NodeValidatorBuilder.common() | 4833 validator = new NodeValidatorBuilder.common() |
4834 ..allowSvg(); | 4834 ..allowSvg(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4879 | 4879 |
4880 /** | 4880 /** |
4881 * Checks to see if the SVG element type is supported by the current platform. | 4881 * Checks to see if the SVG element type is supported by the current platform. |
4882 * | 4882 * |
4883 * The tag should be a valid SVG element tag name. | 4883 * The tag should be a valid SVG element tag name. |
4884 */ | 4884 */ |
4885 static bool isTagSupported(String tag) { | 4885 static bool isTagSupported(String tag) { |
4886 var e = new SvgElement.tag(tag); | 4886 var e = new SvgElement.tag(tag); |
4887 return e is SvgElement && !(e is UnknownElement); | 4887 return e is SvgElement && !(e is UnknownElement); |
4888 } | 4888 } |
4889 | |
4890 // To suppress missing implicit constructor warnings. | 4889 // To suppress missing implicit constructor warnings. |
4891 factory SvgElement._() { throw new UnsupportedError("Not supported"); } | 4890 factory SvgElement._() { throw new UnsupportedError("Not supported"); } |
4892 | 4891 |
4893 @DomName('SVGElement.abortEvent') | 4892 @DomName('SVGElement.abortEvent') |
4894 @DocsEditable() | 4893 @DocsEditable() |
4895 @Experimental() // untriaged | 4894 @Experimental() // untriaged |
4896 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 4895 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
4897 | 4896 |
4898 @DomName('SVGElement.blurEvent') | 4897 @DomName('SVGElement.blurEvent') |
4899 @DocsEditable() | 4898 @DocsEditable() |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5163 @DomName('SVGElement.ownerSVGElement') | 5162 @DomName('SVGElement.ownerSVGElement') |
5164 @DocsEditable() | 5163 @DocsEditable() |
5165 final SvgSvgElement ownerSvgElement; | 5164 final SvgSvgElement ownerSvgElement; |
5166 | 5165 |
5167 // Use implementation from Element. | 5166 // Use implementation from Element. |
5168 // final CssStyleDeclaration style; | 5167 // final CssStyleDeclaration style; |
5169 | 5168 |
5170 // Shadowing definition. | 5169 // Shadowing definition. |
5171 int get tabIndex => JS("int", "#.tabIndex", this); | 5170 int get tabIndex => JS("int", "#.tabIndex", this); |
5172 | 5171 |
5173 set tabIndex(int value) { | 5172 void set tabIndex(int value) { |
5174 JS("void", "#.tabIndex = #", this, value); | 5173 JS("void", "#.tabIndex = #", this, value); |
5175 } | 5174 } |
5176 | 5175 |
5177 @DomName('SVGElement.viewportElement') | 5176 @DomName('SVGElement.viewportElement') |
5178 @DocsEditable() | 5177 @DocsEditable() |
5179 final SvgElement viewportElement; | 5178 final SvgElement viewportElement; |
5180 | 5179 |
5181 @DomName('SVGElement.xmlbase') | 5180 @DomName('SVGElement.xmlbase') |
5182 @DocsEditable() | 5181 @DocsEditable() |
5183 String xmlbase; | 5182 String xmlbase; |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6076 throw new RangeError.index(index, this); | 6075 throw new RangeError.index(index, this); |
6077 return this.getItem(index); | 6076 return this.getItem(index); |
6078 } | 6077 } |
6079 void operator[]=(int index, Transform value) { | 6078 void operator[]=(int index, Transform value) { |
6080 throw new UnsupportedError("Cannot assign element of immutable List."); | 6079 throw new UnsupportedError("Cannot assign element of immutable List."); |
6081 } | 6080 } |
6082 // -- start List<Transform> mixins. | 6081 // -- start List<Transform> mixins. |
6083 // Transform is the element type. | 6082 // Transform is the element type. |
6084 | 6083 |
6085 | 6084 |
6086 set length(int value) { | 6085 void set length(int value) { |
6087 throw new UnsupportedError("Cannot resize immutable List."); | 6086 throw new UnsupportedError("Cannot resize immutable List."); |
6088 } | 6087 } |
6089 | 6088 |
6090 Transform get first { | 6089 Transform get first { |
6091 if (this.length > 0) { | 6090 if (this.length > 0) { |
6092 return JS('Transform', '#[0]', this); | 6091 return JS('Transform', '#[0]', this); |
6093 } | 6092 } |
6094 throw new StateError("No elements"); | 6093 throw new StateError("No elements"); |
6095 } | 6094 } |
6096 | 6095 |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6530 * This can only be called by subclasses from their created constructor. | 6529 * This can only be called by subclasses from their created constructor. |
6531 */ | 6530 */ |
6532 _SVGCursorElement.created() : super.created(); | 6531 _SVGCursorElement.created() : super.created(); |
6533 | 6532 |
6534 /// Checks if this type is supported on the current platform. | 6533 /// Checks if this type is supported on the current platform. |
6535 static bool get supported => SvgElement.isTagSupported('cursor') && (new SvgEl
ement.tag('cursor') is _SVGCursorElement); | 6534 static bool get supported => SvgElement.isTagSupported('cursor') && (new SvgEl
ement.tag('cursor') is _SVGCursorElement); |
6536 | 6535 |
6537 // From SVGTests | 6536 // From SVGTests |
6538 | 6537 |
6539 // From SVGURIReference | 6538 // From SVGURIReference |
6540 | |
6541 } | 6539 } |
6542 | |
6543 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6540 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
6544 // for details. All rights reserved. Use of this source code is governed by a | 6541 // for details. All rights reserved. Use of this source code is governed by a |
6545 // BSD-style license that can be found in the LICENSE file. | 6542 // BSD-style license that can be found in the LICENSE file. |
6546 | 6543 |
6547 | 6544 |
6548 @DocsEditable() | 6545 @DocsEditable() |
6549 @DomName('SVGFEDropShadowElement') | 6546 @DomName('SVGFEDropShadowElement') |
6550 @Experimental() // nonstandard | 6547 @Experimental() // nonstandard |
6551 @Native("SVGFEDropShadowElement") | 6548 @Native("SVGFEDropShadowElement") |
6552 abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimi
tiveStandardAttributes { | 6549 abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimi
tiveStandardAttributes { |
6553 // To suppress missing implicit constructor warnings. | 6550 // To suppress missing implicit constructor warnings. |
6554 factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supporte
d"); } | 6551 factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supporte
d"); } |
6555 /** | 6552 /** |
6556 * Constructor instantiated by the DOM when a custom element has been created. | 6553 * Constructor instantiated by the DOM when a custom element has been created. |
6557 * | 6554 * |
6558 * This can only be called by subclasses from their created constructor. | 6555 * This can only be called by subclasses from their created constructor. |
6559 */ | 6556 */ |
6560 _SVGFEDropShadowElement.created() : super.created(); | 6557 _SVGFEDropShadowElement.created() : super.created(); |
6561 | 6558 |
6562 // From SVGFilterPrimitiveStandardAttributes | 6559 // From SVGFilterPrimitiveStandardAttributes |
6563 | |
6564 } | 6560 } |
6565 | |
6566 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6561 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
6567 // for details. All rights reserved. Use of this source code is governed by a | 6562 // for details. All rights reserved. Use of this source code is governed by a |
6568 // BSD-style license that can be found in the LICENSE file. | 6563 // BSD-style license that can be found in the LICENSE file. |
6569 | 6564 |
6570 | 6565 |
6571 @DocsEditable() | 6566 @DocsEditable() |
6572 @DomName('SVGFontElement') | 6567 @DomName('SVGFontElement') |
6573 @Unstable() | 6568 @Unstable() |
6574 @Native("SVGFontElement") | 6569 @Native("SVGFontElement") |
6575 abstract class _SVGFontElement extends SvgElement { | 6570 abstract class _SVGFontElement extends SvgElement { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6713 // To suppress missing implicit constructor warnings. | 6708 // To suppress missing implicit constructor warnings. |
6714 factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported");
} | 6709 factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported");
} |
6715 /** | 6710 /** |
6716 * Constructor instantiated by the DOM when a custom element has been created. | 6711 * Constructor instantiated by the DOM when a custom element has been created. |
6717 * | 6712 * |
6718 * This can only be called by subclasses from their created constructor. | 6713 * This can only be called by subclasses from their created constructor. |
6719 */ | 6714 */ |
6720 _SVGGlyphRefElement.created() : super.created(); | 6715 _SVGGlyphRefElement.created() : super.created(); |
6721 | 6716 |
6722 // From SVGURIReference | 6717 // From SVGURIReference |
6723 | |
6724 } | 6718 } |
6725 | |
6726 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6719 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
6727 // for details. All rights reserved. Use of this source code is governed by a | 6720 // for details. All rights reserved. Use of this source code is governed by a |
6728 // BSD-style license that can be found in the LICENSE file. | 6721 // BSD-style license that can be found in the LICENSE file. |
6729 | 6722 |
6730 | 6723 |
6731 @DocsEditable() | 6724 @DocsEditable() |
6732 @DomName('SVGHKernElement') | 6725 @DomName('SVGHKernElement') |
6733 @Unstable() | 6726 @Unstable() |
6734 @Native("SVGHKernElement") | 6727 @Native("SVGHKernElement") |
6735 abstract class _SVGHKernElement extends SvgElement { | 6728 abstract class _SVGHKernElement extends SvgElement { |
(...skipping 26 matching lines...) Expand all Loading... |
6762 @DocsEditable() | 6755 @DocsEditable() |
6763 factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"mpath"); | 6756 factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"mpath"); |
6764 /** | 6757 /** |
6765 * Constructor instantiated by the DOM when a custom element has been created. | 6758 * Constructor instantiated by the DOM when a custom element has been created. |
6766 * | 6759 * |
6767 * This can only be called by subclasses from their created constructor. | 6760 * This can only be called by subclasses from their created constructor. |
6768 */ | 6761 */ |
6769 _SVGMPathElement.created() : super.created(); | 6762 _SVGMPathElement.created() : super.created(); |
6770 | 6763 |
6771 // From SVGURIReference | 6764 // From SVGURIReference |
6772 | |
6773 } | 6765 } |
6774 | |
6775 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6766 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
6776 // for details. All rights reserved. Use of this source code is governed by a | 6767 // for details. All rights reserved. Use of this source code is governed by a |
6777 // BSD-style license that can be found in the LICENSE file. | 6768 // BSD-style license that can be found in the LICENSE file. |
6778 | 6769 |
6779 | 6770 |
6780 @DocsEditable() | 6771 @DocsEditable() |
6781 @DomName('SVGMissingGlyphElement') | 6772 @DomName('SVGMissingGlyphElement') |
6782 @Unstable() | 6773 @Unstable() |
6783 @Native("SVGMissingGlyphElement") | 6774 @Native("SVGMissingGlyphElement") |
6784 abstract class _SVGMissingGlyphElement extends SvgElement { | 6775 abstract class _SVGMissingGlyphElement extends SvgElement { |
(...skipping 22 matching lines...) Expand all Loading... |
6807 @DomName('SVGVKernElement.SVGVKernElement') | 6798 @DomName('SVGVKernElement.SVGVKernElement') |
6808 @DocsEditable() | 6799 @DocsEditable() |
6809 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"vkern"); | 6800 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"vkern"); |
6810 /** | 6801 /** |
6811 * Constructor instantiated by the DOM when a custom element has been created. | 6802 * Constructor instantiated by the DOM when a custom element has been created. |
6812 * | 6803 * |
6813 * This can only be called by subclasses from their created constructor. | 6804 * This can only be called by subclasses from their created constructor. |
6814 */ | 6805 */ |
6815 _SVGVKernElement.created() : super.created(); | 6806 _SVGVKernElement.created() : super.created(); |
6816 } | 6807 } |
OLD | NEW |