| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6799 @DomName('SVGVKernElement.SVGVKernElement') | 6798 @DomName('SVGVKernElement.SVGVKernElement') |
| 6800 @DocsEditable() | 6799 @DocsEditable() |
| 6801 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"vkern"); | 6800 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag(
"vkern"); |
| 6802 /** | 6801 /** |
| 6803 * 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. |
| 6804 * | 6803 * |
| 6805 * This can only be called by subclasses from their created constructor. | 6804 * This can only be called by subclasses from their created constructor. |
| 6806 */ | 6805 */ |
| 6807 _SVGVKernElement.created() : super.created(); | 6806 _SVGVKernElement.created() : super.created(); |
| 6808 } | 6807 } |
| OLD | NEW |