Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: sdk/lib/svg/dart2js/svg_dart2js.dart

Issue 1321613005: Dartium w/ JsInterop enabled (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 void set length(int value) { 2696 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
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 void set length(int value) { 3148 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
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 void set length(int value) { 3935 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
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 void set length(int value) { 4630 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
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 void set title(String value) { 4734 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
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 void set children(List<Element> value) { 4804 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 void set innerHtml(String value) { 4824 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
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
4889 // To suppress missing implicit constructor warnings. 4890 // To suppress missing implicit constructor warnings.
4890 factory SvgElement._() { throw new UnsupportedError("Not supported"); } 4891 factory SvgElement._() { throw new UnsupportedError("Not supported"); }
4891 4892
4892 @DomName('SVGElement.abortEvent') 4893 @DomName('SVGElement.abortEvent')
4893 @DocsEditable() 4894 @DocsEditable()
4894 @Experimental() // untriaged 4895 @Experimental() // untriaged
4895 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); 4896 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
4896 4897
4897 @DomName('SVGElement.blurEvent') 4898 @DomName('SVGElement.blurEvent')
4898 @DocsEditable() 4899 @DocsEditable()
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
5162 @DomName('SVGElement.ownerSVGElement') 5163 @DomName('SVGElement.ownerSVGElement')
5163 @DocsEditable() 5164 @DocsEditable()
5164 final SvgSvgElement ownerSvgElement; 5165 final SvgSvgElement ownerSvgElement;
5165 5166
5166 // Use implementation from Element. 5167 // Use implementation from Element.
5167 // final CssStyleDeclaration style; 5168 // final CssStyleDeclaration style;
5168 5169
5169 // Shadowing definition. 5170 // Shadowing definition.
5170 int get tabIndex => JS("int", "#.tabIndex", this); 5171 int get tabIndex => JS("int", "#.tabIndex", this);
5171 5172
5172 void set tabIndex(int value) { 5173 set tabIndex(int value) {
5173 JS("void", "#.tabIndex = #", this, value); 5174 JS("void", "#.tabIndex = #", this, value);
5174 } 5175 }
5175 5176
5176 @DomName('SVGElement.viewportElement') 5177 @DomName('SVGElement.viewportElement')
5177 @DocsEditable() 5178 @DocsEditable()
5178 final SvgElement viewportElement; 5179 final SvgElement viewportElement;
5179 5180
5180 @DomName('SVGElement.xmlbase') 5181 @DomName('SVGElement.xmlbase')
5181 @DocsEditable() 5182 @DocsEditable()
5182 String xmlbase; 5183 String xmlbase;
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
6075 throw new RangeError.index(index, this); 6076 throw new RangeError.index(index, this);
6076 return this.getItem(index); 6077 return this.getItem(index);
6077 } 6078 }
6078 void operator[]=(int index, Transform value) { 6079 void operator[]=(int index, Transform value) {
6079 throw new UnsupportedError("Cannot assign element of immutable List."); 6080 throw new UnsupportedError("Cannot assign element of immutable List.");
6080 } 6081 }
6081 // -- start List<Transform> mixins. 6082 // -- start List<Transform> mixins.
6082 // Transform is the element type. 6083 // Transform is the element type.
6083 6084
6084 6085
6085 void set length(int value) { 6086 set length(int value) {
6086 throw new UnsupportedError("Cannot resize immutable List."); 6087 throw new UnsupportedError("Cannot resize immutable List.");
6087 } 6088 }
6088 6089
6089 Transform get first { 6090 Transform get first {
6090 if (this.length > 0) { 6091 if (this.length > 0) {
6091 return JS('Transform', '#[0]', this); 6092 return JS('Transform', '#[0]', this);
6092 } 6093 }
6093 throw new StateError("No elements"); 6094 throw new StateError("No elements");
6094 } 6095 }
6095 6096
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
6529 * This can only be called by subclasses from their created constructor. 6530 * This can only be called by subclasses from their created constructor.
6530 */ 6531 */
6531 _SVGCursorElement.created() : super.created(); 6532 _SVGCursorElement.created() : super.created();
6532 6533
6533 /// Checks if this type is supported on the current platform. 6534 /// Checks if this type is supported on the current platform.
6534 static bool get supported => SvgElement.isTagSupported('cursor') && (new SvgEl ement.tag('cursor') is _SVGCursorElement); 6535 static bool get supported => SvgElement.isTagSupported('cursor') && (new SvgEl ement.tag('cursor') is _SVGCursorElement);
6535 6536
6536 // From SVGTests 6537 // From SVGTests
6537 6538
6538 // From SVGURIReference 6539 // From SVGURIReference
6540
6539 } 6541 }
6542
6540 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6543 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6541 // for details. All rights reserved. Use of this source code is governed by a 6544 // for details. All rights reserved. Use of this source code is governed by a
6542 // BSD-style license that can be found in the LICENSE file. 6545 // BSD-style license that can be found in the LICENSE file.
6543 6546
6544 6547
6545 @DocsEditable() 6548 @DocsEditable()
6546 @DomName('SVGFEDropShadowElement') 6549 @DomName('SVGFEDropShadowElement')
6547 @Experimental() // nonstandard 6550 @Experimental() // nonstandard
6548 @Native("SVGFEDropShadowElement") 6551 @Native("SVGFEDropShadowElement")
6549 abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimi tiveStandardAttributes { 6552 abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimi tiveStandardAttributes {
6550 // To suppress missing implicit constructor warnings. 6553 // To suppress missing implicit constructor warnings.
6551 factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supporte d"); } 6554 factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supporte d"); }
6552 /** 6555 /**
6553 * Constructor instantiated by the DOM when a custom element has been created. 6556 * Constructor instantiated by the DOM when a custom element has been created.
6554 * 6557 *
6555 * This can only be called by subclasses from their created constructor. 6558 * This can only be called by subclasses from their created constructor.
6556 */ 6559 */
6557 _SVGFEDropShadowElement.created() : super.created(); 6560 _SVGFEDropShadowElement.created() : super.created();
6558 6561
6559 // From SVGFilterPrimitiveStandardAttributes 6562 // From SVGFilterPrimitiveStandardAttributes
6563
6560 } 6564 }
6565
6561 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6566 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6562 // for details. All rights reserved. Use of this source code is governed by a 6567 // for details. All rights reserved. Use of this source code is governed by a
6563 // BSD-style license that can be found in the LICENSE file. 6568 // BSD-style license that can be found in the LICENSE file.
6564 6569
6565 6570
6566 @DocsEditable() 6571 @DocsEditable()
6567 @DomName('SVGFontElement') 6572 @DomName('SVGFontElement')
6568 @Unstable() 6573 @Unstable()
6569 @Native("SVGFontElement") 6574 @Native("SVGFontElement")
6570 abstract class _SVGFontElement extends SvgElement { 6575 abstract class _SVGFontElement extends SvgElement {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
6708 // To suppress missing implicit constructor warnings. 6713 // To suppress missing implicit constructor warnings.
6709 factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported"); } 6714 factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported"); }
6710 /** 6715 /**
6711 * Constructor instantiated by the DOM when a custom element has been created. 6716 * Constructor instantiated by the DOM when a custom element has been created.
6712 * 6717 *
6713 * This can only be called by subclasses from their created constructor. 6718 * This can only be called by subclasses from their created constructor.
6714 */ 6719 */
6715 _SVGGlyphRefElement.created() : super.created(); 6720 _SVGGlyphRefElement.created() : super.created();
6716 6721
6717 // From SVGURIReference 6722 // From SVGURIReference
6723
6718 } 6724 }
6725
6719 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6726 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6720 // for details. All rights reserved. Use of this source code is governed by a 6727 // for details. All rights reserved. Use of this source code is governed by a
6721 // BSD-style license that can be found in the LICENSE file. 6728 // BSD-style license that can be found in the LICENSE file.
6722 6729
6723 6730
6724 @DocsEditable() 6731 @DocsEditable()
6725 @DomName('SVGHKernElement') 6732 @DomName('SVGHKernElement')
6726 @Unstable() 6733 @Unstable()
6727 @Native("SVGHKernElement") 6734 @Native("SVGHKernElement")
6728 abstract class _SVGHKernElement extends SvgElement { 6735 abstract class _SVGHKernElement extends SvgElement {
(...skipping 26 matching lines...) Expand all
6755 @DocsEditable() 6762 @DocsEditable()
6756 factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag( "mpath"); 6763 factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag( "mpath");
6757 /** 6764 /**
6758 * Constructor instantiated by the DOM when a custom element has been created. 6765 * Constructor instantiated by the DOM when a custom element has been created.
6759 * 6766 *
6760 * This can only be called by subclasses from their created constructor. 6767 * This can only be called by subclasses from their created constructor.
6761 */ 6768 */
6762 _SVGMPathElement.created() : super.created(); 6769 _SVGMPathElement.created() : super.created();
6763 6770
6764 // From SVGURIReference 6771 // From SVGURIReference
6772
6765 } 6773 }
6774
6766 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6775 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6767 // for details. All rights reserved. Use of this source code is governed by a 6776 // for details. All rights reserved. Use of this source code is governed by a
6768 // BSD-style license that can be found in the LICENSE file. 6777 // BSD-style license that can be found in the LICENSE file.
6769 6778
6770 6779
6771 @DocsEditable() 6780 @DocsEditable()
6772 @DomName('SVGMissingGlyphElement') 6781 @DomName('SVGMissingGlyphElement')
6773 @Unstable() 6782 @Unstable()
6774 @Native("SVGMissingGlyphElement") 6783 @Native("SVGMissingGlyphElement")
6775 abstract class _SVGMissingGlyphElement extends SvgElement { 6784 abstract class _SVGMissingGlyphElement extends SvgElement {
(...skipping 22 matching lines...) Expand all
6798 @DomName('SVGVKernElement.SVGVKernElement') 6807 @DomName('SVGVKernElement.SVGVKernElement')
6799 @DocsEditable() 6808 @DocsEditable()
6800 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern"); 6809 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern");
6801 /** 6810 /**
6802 * Constructor instantiated by the DOM when a custom element has been created. 6811 * Constructor instantiated by the DOM when a custom element has been created.
6803 * 6812 *
6804 * This can only be called by subclasses from their created constructor. 6813 * This can only be called by subclasses from their created constructor.
6805 */ 6814 */
6806 _SVGVKernElement.created() : super.created(); 6815 _SVGVKernElement.created() : super.created();
6807 } 6816 }
OLDNEW
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698