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

Side by Side Diff: sdk/lib/svg/dartium/svg_dartium.dart

Issue 14619013: Explicitly implementing some DOM iterable APIs for performance (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 library dart.dom.svg; 1 library dart.dom.svg;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:_collection-dev'; 5 import 'dart:_collection-dev';
6 import 'dart:html'; 6 import 'dart:html';
7 import 'dart:html_common'; 7 import 'dart:html_common';
8 import 'dart:nativewrappers'; 8 import 'dart:nativewrappers';
9 // DO NOT EDIT 9 // DO NOT EDIT
10 // Auto-generated dart:svg library. 10 // Auto-generated dart:svg library.
(...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 3266
3267 @DocsEditable 3267 @DocsEditable
3268 @DomName('SVGLengthList') 3268 @DomName('SVGLengthList')
3269 class LengthList extends NativeFieldWrapperClass1 with ListMixin<Length>, Immuta bleListMixin<Length> implements List<Length> { 3269 class LengthList extends NativeFieldWrapperClass1 with ListMixin<Length>, Immuta bleListMixin<Length> implements List<Length> {
3270 LengthList.internal(); 3270 LengthList.internal();
3271 3271
3272 @DomName('SVGLengthList.numberOfItems') 3272 @DomName('SVGLengthList.numberOfItems')
3273 @DocsEditable 3273 @DocsEditable
3274 int get numberOfItems native "SVGLengthList_numberOfItems_Getter"; 3274 int get numberOfItems native "SVGLengthList_numberOfItems_Getter";
3275 3275
3276 Length operator[](int index) native "SVGLengthList_item_Callback"; 3276 Length operator[](int index) {
3277 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
3278 return _nativeIndexedGetter(index);
3279 }
3280 Length _nativeIndexedGetter(int index) native "SVGLengthList_item_Callback";
3277 3281
3278 void operator[]=(int index, Length value) { 3282 void operator[]=(int index, Length value) {
3279 throw new UnsupportedError("Cannot assign element of immutable List."); 3283 throw new UnsupportedError("Cannot assign element of immutable List.");
3280 } 3284 }
3281 // -- start List<Length> mixins. 3285 // -- start List<Length> mixins.
3282 // Length is the element type. 3286 // Length is the element type.
3283 3287
3284 // SVG Collections expose numberOfItems rather than length. 3288 // SVG Collections expose numberOfItems rather than length.
3285 int get length => numberOfItems; 3289 int get length => numberOfItems;
3286 3290
3287 void set length(int value) { 3291 void set length(int value) {
3288 throw new UnsupportedError("Cannot resize immutable List."); 3292 throw new UnsupportedError("Cannot resize immutable List.");
3289 } 3293 }
3290 3294
3295 Length get first {
3296 if (this.length > 0) {
3297 return this[0];
3298 }
3299 throw new StateError("No elements");
3300 }
3301
3302 Length get last {
3303 int len = this.length;
3304 if (len > 0) {
3305 return this[len - 1];
3306 }
3307 throw new StateError("No elements");
3308 }
3309
3310 Length get single {
3311 int len = this.length;
3312 if (len == 1) {
3313 return this[0];
3314 }
3315 if (len == 0) throw new StateError("No elements");
3316 throw new StateError("More than one element");
3317 }
3318
3319 Length elementAt(int index) {
3320 return this[index];
3321 }
3322
3291 // -- end List<Length> mixins. 3323 // -- end List<Length> mixins.
3292 3324
3293 @DomName('SVGLengthList.appendItem') 3325 @DomName('SVGLengthList.appendItem')
3294 @DocsEditable 3326 @DocsEditable
3295 Length appendItem(Length item) native "SVGLengthList_appendItem_Callback"; 3327 Length appendItem(Length item) native "SVGLengthList_appendItem_Callback";
3296 3328
3297 @DomName('SVGLengthList.clear') 3329 @DomName('SVGLengthList.clear')
3298 @DocsEditable 3330 @DocsEditable
3299 void clear() native "SVGLengthList_clear_Callback"; 3331 void clear() native "SVGLengthList_clear_Callback";
3300 3332
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 3836
3805 @DocsEditable 3837 @DocsEditable
3806 @DomName('SVGNumberList') 3838 @DomName('SVGNumberList')
3807 class NumberList extends NativeFieldWrapperClass1 with ListMixin<Number>, Immuta bleListMixin<Number> implements List<Number> { 3839 class NumberList extends NativeFieldWrapperClass1 with ListMixin<Number>, Immuta bleListMixin<Number> implements List<Number> {
3808 NumberList.internal(); 3840 NumberList.internal();
3809 3841
3810 @DomName('SVGNumberList.numberOfItems') 3842 @DomName('SVGNumberList.numberOfItems')
3811 @DocsEditable 3843 @DocsEditable
3812 int get numberOfItems native "SVGNumberList_numberOfItems_Getter"; 3844 int get numberOfItems native "SVGNumberList_numberOfItems_Getter";
3813 3845
3814 Number operator[](int index) native "SVGNumberList_item_Callback"; 3846 Number operator[](int index) {
3847 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
3848 return _nativeIndexedGetter(index);
3849 }
3850 Number _nativeIndexedGetter(int index) native "SVGNumberList_item_Callback";
3815 3851
3816 void operator[]=(int index, Number value) { 3852 void operator[]=(int index, Number value) {
3817 throw new UnsupportedError("Cannot assign element of immutable List."); 3853 throw new UnsupportedError("Cannot assign element of immutable List.");
3818 } 3854 }
3819 // -- start List<Number> mixins. 3855 // -- start List<Number> mixins.
3820 // Number is the element type. 3856 // Number is the element type.
3821 3857
3822 // SVG Collections expose numberOfItems rather than length. 3858 // SVG Collections expose numberOfItems rather than length.
3823 int get length => numberOfItems; 3859 int get length => numberOfItems;
3824 3860
3825 void set length(int value) { 3861 void set length(int value) {
3826 throw new UnsupportedError("Cannot resize immutable List."); 3862 throw new UnsupportedError("Cannot resize immutable List.");
3827 } 3863 }
3828 3864
3865 Number get first {
3866 if (this.length > 0) {
3867 return this[0];
3868 }
3869 throw new StateError("No elements");
3870 }
3871
3872 Number get last {
3873 int len = this.length;
3874 if (len > 0) {
3875 return this[len - 1];
3876 }
3877 throw new StateError("No elements");
3878 }
3879
3880 Number get single {
3881 int len = this.length;
3882 if (len == 1) {
3883 return this[0];
3884 }
3885 if (len == 0) throw new StateError("No elements");
3886 throw new StateError("More than one element");
3887 }
3888
3889 Number elementAt(int index) {
3890 return this[index];
3891 }
3892
3829 // -- end List<Number> mixins. 3893 // -- end List<Number> mixins.
3830 3894
3831 @DomName('SVGNumberList.appendItem') 3895 @DomName('SVGNumberList.appendItem')
3832 @DocsEditable 3896 @DocsEditable
3833 Number appendItem(Number item) native "SVGNumberList_appendItem_Callback"; 3897 Number appendItem(Number item) native "SVGNumberList_appendItem_Callback";
3834 3898
3835 @DomName('SVGNumberList.clear') 3899 @DomName('SVGNumberList.clear')
3836 @DocsEditable 3900 @DocsEditable
3837 void clear() native "SVGNumberList_clear_Callback"; 3901 void clear() native "SVGNumberList_clear_Callback";
3838 3902
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
4769 4833
4770 @DocsEditable 4834 @DocsEditable
4771 @DomName('SVGPathSegList') 4835 @DomName('SVGPathSegList')
4772 class PathSegList extends NativeFieldWrapperClass1 with ListMixin<PathSeg>, Immu tableListMixin<PathSeg> implements List<PathSeg> { 4836 class PathSegList extends NativeFieldWrapperClass1 with ListMixin<PathSeg>, Immu tableListMixin<PathSeg> implements List<PathSeg> {
4773 PathSegList.internal(); 4837 PathSegList.internal();
4774 4838
4775 @DomName('SVGPathSegList.numberOfItems') 4839 @DomName('SVGPathSegList.numberOfItems')
4776 @DocsEditable 4840 @DocsEditable
4777 int get numberOfItems native "SVGPathSegList_numberOfItems_Getter"; 4841 int get numberOfItems native "SVGPathSegList_numberOfItems_Getter";
4778 4842
4779 PathSeg operator[](int index) native "SVGPathSegList_item_Callback"; 4843 PathSeg operator[](int index) {
4844 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
4845 return _nativeIndexedGetter(index);
4846 }
4847 PathSeg _nativeIndexedGetter(int index) native "SVGPathSegList_item_Callback";
4780 4848
4781 void operator[]=(int index, PathSeg value) { 4849 void operator[]=(int index, PathSeg value) {
4782 throw new UnsupportedError("Cannot assign element of immutable List."); 4850 throw new UnsupportedError("Cannot assign element of immutable List.");
4783 } 4851 }
4784 // -- start List<PathSeg> mixins. 4852 // -- start List<PathSeg> mixins.
4785 // PathSeg is the element type. 4853 // PathSeg is the element type.
4786 4854
4787 // SVG Collections expose numberOfItems rather than length. 4855 // SVG Collections expose numberOfItems rather than length.
4788 int get length => numberOfItems; 4856 int get length => numberOfItems;
4789 4857
4790 void set length(int value) { 4858 void set length(int value) {
4791 throw new UnsupportedError("Cannot resize immutable List."); 4859 throw new UnsupportedError("Cannot resize immutable List.");
4792 } 4860 }
4793 4861
4862 PathSeg get first {
4863 if (this.length > 0) {
4864 return this[0];
4865 }
4866 throw new StateError("No elements");
4867 }
4868
4869 PathSeg get last {
4870 int len = this.length;
4871 if (len > 0) {
4872 return this[len - 1];
4873 }
4874 throw new StateError("No elements");
4875 }
4876
4877 PathSeg get single {
4878 int len = this.length;
4879 if (len == 1) {
4880 return this[0];
4881 }
4882 if (len == 0) throw new StateError("No elements");
4883 throw new StateError("More than one element");
4884 }
4885
4886 PathSeg elementAt(int index) {
4887 return this[index];
4888 }
4889
4794 // -- end List<PathSeg> mixins. 4890 // -- end List<PathSeg> mixins.
4795 4891
4796 @DomName('SVGPathSegList.appendItem') 4892 @DomName('SVGPathSegList.appendItem')
4797 @DocsEditable 4893 @DocsEditable
4798 PathSeg appendItem(PathSeg newItem) native "SVGPathSegList_appendItem_Callback "; 4894 PathSeg appendItem(PathSeg newItem) native "SVGPathSegList_appendItem_Callback ";
4799 4895
4800 @DomName('SVGPathSegList.clear') 4896 @DomName('SVGPathSegList.clear')
4801 @DocsEditable 4897 @DocsEditable
4802 void clear() native "SVGPathSegList_clear_Callback"; 4898 void clear() native "SVGPathSegList_clear_Callback";
4803 4899
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
5588 5684
5589 @DocsEditable 5685 @DocsEditable
5590 @DomName('SVGStringList') 5686 @DomName('SVGStringList')
5591 class StringList extends NativeFieldWrapperClass1 with ListMixin<String>, Immuta bleListMixin<String> implements List<String> { 5687 class StringList extends NativeFieldWrapperClass1 with ListMixin<String>, Immuta bleListMixin<String> implements List<String> {
5592 StringList.internal(); 5688 StringList.internal();
5593 5689
5594 @DomName('SVGStringList.numberOfItems') 5690 @DomName('SVGStringList.numberOfItems')
5595 @DocsEditable 5691 @DocsEditable
5596 int get numberOfItems native "SVGStringList_numberOfItems_Getter"; 5692 int get numberOfItems native "SVGStringList_numberOfItems_Getter";
5597 5693
5598 String operator[](int index) native "SVGStringList_item_Callback"; 5694 String operator[](int index) {
5695 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
5696 return _nativeIndexedGetter(index);
5697 }
5698 String _nativeIndexedGetter(int index) native "SVGStringList_item_Callback";
5599 5699
5600 void operator[]=(int index, String value) { 5700 void operator[]=(int index, String value) {
5601 throw new UnsupportedError("Cannot assign element of immutable List."); 5701 throw new UnsupportedError("Cannot assign element of immutable List.");
5602 } 5702 }
5603 // -- start List<String> mixins. 5703 // -- start List<String> mixins.
5604 // String is the element type. 5704 // String is the element type.
5605 5705
5606 // SVG Collections expose numberOfItems rather than length. 5706 // SVG Collections expose numberOfItems rather than length.
5607 int get length => numberOfItems; 5707 int get length => numberOfItems;
5608 5708
5609 void set length(int value) { 5709 void set length(int value) {
5610 throw new UnsupportedError("Cannot resize immutable List."); 5710 throw new UnsupportedError("Cannot resize immutable List.");
5611 } 5711 }
5612 5712
5713 String get first {
5714 if (this.length > 0) {
5715 return this[0];
5716 }
5717 throw new StateError("No elements");
5718 }
5719
5720 String get last {
5721 int len = this.length;
5722 if (len > 0) {
5723 return this[len - 1];
5724 }
5725 throw new StateError("No elements");
5726 }
5727
5728 String get single {
5729 int len = this.length;
5730 if (len == 1) {
5731 return this[0];
5732 }
5733 if (len == 0) throw new StateError("No elements");
5734 throw new StateError("More than one element");
5735 }
5736
5737 String elementAt(int index) {
5738 return this[index];
5739 }
5740
5613 // -- end List<String> mixins. 5741 // -- end List<String> mixins.
5614 5742
5615 @DomName('SVGStringList.appendItem') 5743 @DomName('SVGStringList.appendItem')
5616 @DocsEditable 5744 @DocsEditable
5617 String appendItem(String item) native "SVGStringList_appendItem_Callback"; 5745 String appendItem(String item) native "SVGStringList_appendItem_Callback";
5618 5746
5619 @DomName('SVGStringList.clear') 5747 @DomName('SVGStringList.clear')
5620 @DocsEditable 5748 @DocsEditable
5621 void clear() native "SVGStringList_clear_Callback"; 5749 void clear() native "SVGStringList_clear_Callback";
5622 5750
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
6672 6800
6673 @DocsEditable 6801 @DocsEditable
6674 @DomName('SVGTransformList') 6802 @DomName('SVGTransformList')
6675 class TransformList extends NativeFieldWrapperClass1 with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> { 6803 class TransformList extends NativeFieldWrapperClass1 with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> {
6676 TransformList.internal(); 6804 TransformList.internal();
6677 6805
6678 @DomName('SVGTransformList.numberOfItems') 6806 @DomName('SVGTransformList.numberOfItems')
6679 @DocsEditable 6807 @DocsEditable
6680 int get numberOfItems native "SVGTransformList_numberOfItems_Getter"; 6808 int get numberOfItems native "SVGTransformList_numberOfItems_Getter";
6681 6809
6682 Transform operator[](int index) native "SVGTransformList_item_Callback"; 6810 Transform operator[](int index) {
6811 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
6812 return _nativeIndexedGetter(index);
6813 }
6814 Transform _nativeIndexedGetter(int index) native "SVGTransformList_item_Callba ck";
6683 6815
6684 void operator[]=(int index, Transform value) { 6816 void operator[]=(int index, Transform value) {
6685 throw new UnsupportedError("Cannot assign element of immutable List."); 6817 throw new UnsupportedError("Cannot assign element of immutable List.");
6686 } 6818 }
6687 // -- start List<Transform> mixins. 6819 // -- start List<Transform> mixins.
6688 // Transform is the element type. 6820 // Transform is the element type.
6689 6821
6690 // SVG Collections expose numberOfItems rather than length. 6822 // SVG Collections expose numberOfItems rather than length.
6691 int get length => numberOfItems; 6823 int get length => numberOfItems;
6692 6824
6693 void set length(int value) { 6825 void set length(int value) {
6694 throw new UnsupportedError("Cannot resize immutable List."); 6826 throw new UnsupportedError("Cannot resize immutable List.");
6695 } 6827 }
6696 6828
6829 Transform get first {
6830 if (this.length > 0) {
6831 return this[0];
6832 }
6833 throw new StateError("No elements");
6834 }
6835
6836 Transform get last {
6837 int len = this.length;
6838 if (len > 0) {
6839 return this[len - 1];
6840 }
6841 throw new StateError("No elements");
6842 }
6843
6844 Transform get single {
6845 int len = this.length;
6846 if (len == 1) {
6847 return this[0];
6848 }
6849 if (len == 0) throw new StateError("No elements");
6850 throw new StateError("More than one element");
6851 }
6852
6853 Transform elementAt(int index) {
6854 return this[index];
6855 }
6856
6697 // -- end List<Transform> mixins. 6857 // -- end List<Transform> mixins.
6698 6858
6699 @DomName('SVGTransformList.appendItem') 6859 @DomName('SVGTransformList.appendItem')
6700 @DocsEditable 6860 @DocsEditable
6701 Transform appendItem(Transform item) native "SVGTransformList_appendItem_Callb ack"; 6861 Transform appendItem(Transform item) native "SVGTransformList_appendItem_Callb ack";
6702 6862
6703 @DomName('SVGTransformList.clear') 6863 @DomName('SVGTransformList.clear')
6704 @DocsEditable 6864 @DocsEditable
6705 void clear() native "SVGTransformList_clear_Callback"; 6865 void clear() native "SVGTransformList_clear_Callback";
6706 6866
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
7082 7242
7083 @DocsEditable 7243 @DocsEditable
7084 @DomName('SVGElementInstanceList') 7244 @DomName('SVGElementInstanceList')
7085 class _ElementInstanceList extends NativeFieldWrapperClass1 with ListMixin<Eleme ntInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance > { 7245 class _ElementInstanceList extends NativeFieldWrapperClass1 with ListMixin<Eleme ntInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance > {
7086 _ElementInstanceList.internal(); 7246 _ElementInstanceList.internal();
7087 7247
7088 @DomName('SVGElementInstanceList.length') 7248 @DomName('SVGElementInstanceList.length')
7089 @DocsEditable 7249 @DocsEditable
7090 int get length native "SVGElementInstanceList_length_Getter"; 7250 int get length native "SVGElementInstanceList_length_Getter";
7091 7251
7092 ElementInstance operator[](int index) native "SVGElementInstanceList_item_Call back"; 7252 ElementInstance operator[](int index) {
7253 if (index < 0 || index >= length) throw new RangeError.range(index, 0, lengt h);
7254 return _nativeIndexedGetter(index);
7255 }
7256 ElementInstance _nativeIndexedGetter(int index) native "SVGElementInstanceList _item_Callback";
7093 7257
7094 void operator[]=(int index, ElementInstance value) { 7258 void operator[]=(int index, ElementInstance value) {
7095 throw new UnsupportedError("Cannot assign element of immutable List."); 7259 throw new UnsupportedError("Cannot assign element of immutable List.");
7096 } 7260 }
7097 // -- start List<ElementInstance> mixins. 7261 // -- start List<ElementInstance> mixins.
7098 // ElementInstance is the element type. 7262 // ElementInstance is the element type.
7099 7263
7100 7264
7101 void set length(int value) { 7265 void set length(int value) {
7102 throw new UnsupportedError("Cannot resize immutable List."); 7266 throw new UnsupportedError("Cannot resize immutable List.");
7103 } 7267 }
7104 7268
7269 ElementInstance get first {
7270 if (this.length > 0) {
7271 return this[0];
7272 }
7273 throw new StateError("No elements");
7274 }
7275
7276 ElementInstance get last {
7277 int len = this.length;
7278 if (len > 0) {
7279 return this[len - 1];
7280 }
7281 throw new StateError("No elements");
7282 }
7283
7284 ElementInstance get single {
7285 int len = this.length;
7286 if (len == 1) {
7287 return this[0];
7288 }
7289 if (len == 0) throw new StateError("No elements");
7290 throw new StateError("More than one element");
7291 }
7292
7293 ElementInstance elementAt(int index) {
7294 return this[index];
7295 }
7296
7105 // -- end List<ElementInstance> mixins. 7297 // -- end List<ElementInstance> mixins.
7106 7298
7107 @DomName('SVGElementInstanceList.item') 7299 @DomName('SVGElementInstanceList.item')
7108 @DocsEditable 7300 @DocsEditable
7109 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback"; 7301 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback";
7110 7302
7111 } 7303 }
7112 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7304 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7113 // for details. All rights reserved. Use of this source code is governed by a 7305 // for details. All rights reserved. Use of this source code is governed by a
7114 // BSD-style license that can be found in the LICENSE file. 7306 // BSD-style license that can be found in the LICENSE file.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
7442 @DocsEditable 7634 @DocsEditable
7443 @DomName('SVGVKernElement') 7635 @DomName('SVGVKernElement')
7444 abstract class _SVGVKernElement extends SvgElement { 7636 abstract class _SVGVKernElement extends SvgElement {
7445 _SVGVKernElement.internal() : super.internal(); 7637 _SVGVKernElement.internal() : super.internal();
7446 7638
7447 @DomName('SVGVKernElement.SVGVKernElement') 7639 @DomName('SVGVKernElement.SVGVKernElement')
7448 @DocsEditable 7640 @DocsEditable
7449 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern"); 7641 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern");
7450 7642
7451 } 7643 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698