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

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
« no previous file with comments | « sdk/lib/svg/dart2js/svg_dart2js.dart ('k') | sdk/lib/web_sql/dart2js/web_sql_dart2js.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 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)
3278 throw new RangeError.range(index, 0, length);
3279 return _nativeIndexedGetter(index);
3280 }
3281 Length _nativeIndexedGetter(int index) native "SVGLengthList_item_Callback";
3277 3282
3278 void operator[]=(int index, Length value) { 3283 void operator[]=(int index, Length value) {
3279 throw new UnsupportedError("Cannot assign element of immutable List."); 3284 throw new UnsupportedError("Cannot assign element of immutable List.");
3280 } 3285 }
3281 // -- start List<Length> mixins. 3286 // -- start List<Length> mixins.
3282 // Length is the element type. 3287 // Length is the element type.
3283 3288
3284 // SVG Collections expose numberOfItems rather than length. 3289 // SVG Collections expose numberOfItems rather than length.
3285 int get length => numberOfItems; 3290 int get length => numberOfItems;
3286 3291
3287 void set length(int value) { 3292 void set length(int value) {
3288 throw new UnsupportedError("Cannot resize immutable List."); 3293 throw new UnsupportedError("Cannot resize immutable List.");
3289 } 3294 }
3290 3295
3296 Length get first {
3297 if (this.length > 0) {
3298 return this[0];
3299 }
3300 throw new StateError("No elements");
3301 }
3302
3303 Length get last {
3304 int len = this.length;
3305 if (len > 0) {
3306 return this[len - 1];
3307 }
3308 throw new StateError("No elements");
3309 }
3310
3311 Length get single {
3312 int len = this.length;
3313 if (len == 1) {
3314 return this[0];
3315 }
3316 if (len == 0) throw new StateError("No elements");
3317 throw new StateError("More than one element");
3318 }
3319
3320 Length elementAt(int index) => this[index];
3291 // -- end List<Length> mixins. 3321 // -- end List<Length> mixins.
3292 3322
3293 @DomName('SVGLengthList.appendItem') 3323 @DomName('SVGLengthList.appendItem')
3294 @DocsEditable 3324 @DocsEditable
3295 Length appendItem(Length item) native "SVGLengthList_appendItem_Callback"; 3325 Length appendItem(Length item) native "SVGLengthList_appendItem_Callback";
3296 3326
3297 @DomName('SVGLengthList.clear') 3327 @DomName('SVGLengthList.clear')
3298 @DocsEditable 3328 @DocsEditable
3299 void clear() native "SVGLengthList_clear_Callback"; 3329 void clear() native "SVGLengthList_clear_Callback";
3300 3330
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 3834
3805 @DocsEditable 3835 @DocsEditable
3806 @DomName('SVGNumberList') 3836 @DomName('SVGNumberList')
3807 class NumberList extends NativeFieldWrapperClass1 with ListMixin<Number>, Immuta bleListMixin<Number> implements List<Number> { 3837 class NumberList extends NativeFieldWrapperClass1 with ListMixin<Number>, Immuta bleListMixin<Number> implements List<Number> {
3808 NumberList.internal(); 3838 NumberList.internal();
3809 3839
3810 @DomName('SVGNumberList.numberOfItems') 3840 @DomName('SVGNumberList.numberOfItems')
3811 @DocsEditable 3841 @DocsEditable
3812 int get numberOfItems native "SVGNumberList_numberOfItems_Getter"; 3842 int get numberOfItems native "SVGNumberList_numberOfItems_Getter";
3813 3843
3814 Number operator[](int index) native "SVGNumberList_item_Callback"; 3844 Number operator[](int index) {
3845 if (index < 0 || index >= length)
3846 throw new RangeError.range(index, 0, length);
3847 return _nativeIndexedGetter(index);
3848 }
3849 Number _nativeIndexedGetter(int index) native "SVGNumberList_item_Callback";
3815 3850
3816 void operator[]=(int index, Number value) { 3851 void operator[]=(int index, Number value) {
3817 throw new UnsupportedError("Cannot assign element of immutable List."); 3852 throw new UnsupportedError("Cannot assign element of immutable List.");
3818 } 3853 }
3819 // -- start List<Number> mixins. 3854 // -- start List<Number> mixins.
3820 // Number is the element type. 3855 // Number is the element type.
3821 3856
3822 // SVG Collections expose numberOfItems rather than length. 3857 // SVG Collections expose numberOfItems rather than length.
3823 int get length => numberOfItems; 3858 int get length => numberOfItems;
3824 3859
3825 void set length(int value) { 3860 void set length(int value) {
3826 throw new UnsupportedError("Cannot resize immutable List."); 3861 throw new UnsupportedError("Cannot resize immutable List.");
3827 } 3862 }
3828 3863
3864 Number get first {
3865 if (this.length > 0) {
3866 return this[0];
3867 }
3868 throw new StateError("No elements");
3869 }
3870
3871 Number get last {
3872 int len = this.length;
3873 if (len > 0) {
3874 return this[len - 1];
3875 }
3876 throw new StateError("No elements");
3877 }
3878
3879 Number get single {
3880 int len = this.length;
3881 if (len == 1) {
3882 return this[0];
3883 }
3884 if (len == 0) throw new StateError("No elements");
3885 throw new StateError("More than one element");
3886 }
3887
3888 Number elementAt(int index) => this[index];
3829 // -- end List<Number> mixins. 3889 // -- end List<Number> mixins.
3830 3890
3831 @DomName('SVGNumberList.appendItem') 3891 @DomName('SVGNumberList.appendItem')
3832 @DocsEditable 3892 @DocsEditable
3833 Number appendItem(Number item) native "SVGNumberList_appendItem_Callback"; 3893 Number appendItem(Number item) native "SVGNumberList_appendItem_Callback";
3834 3894
3835 @DomName('SVGNumberList.clear') 3895 @DomName('SVGNumberList.clear')
3836 @DocsEditable 3896 @DocsEditable
3837 void clear() native "SVGNumberList_clear_Callback"; 3897 void clear() native "SVGNumberList_clear_Callback";
3838 3898
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
4769 4829
4770 @DocsEditable 4830 @DocsEditable
4771 @DomName('SVGPathSegList') 4831 @DomName('SVGPathSegList')
4772 class PathSegList extends NativeFieldWrapperClass1 with ListMixin<PathSeg>, Immu tableListMixin<PathSeg> implements List<PathSeg> { 4832 class PathSegList extends NativeFieldWrapperClass1 with ListMixin<PathSeg>, Immu tableListMixin<PathSeg> implements List<PathSeg> {
4773 PathSegList.internal(); 4833 PathSegList.internal();
4774 4834
4775 @DomName('SVGPathSegList.numberOfItems') 4835 @DomName('SVGPathSegList.numberOfItems')
4776 @DocsEditable 4836 @DocsEditable
4777 int get numberOfItems native "SVGPathSegList_numberOfItems_Getter"; 4837 int get numberOfItems native "SVGPathSegList_numberOfItems_Getter";
4778 4838
4779 PathSeg operator[](int index) native "SVGPathSegList_item_Callback"; 4839 PathSeg operator[](int index) {
4840 if (index < 0 || index >= length)
4841 throw new RangeError.range(index, 0, length);
4842 return _nativeIndexedGetter(index);
4843 }
4844 PathSeg _nativeIndexedGetter(int index) native "SVGPathSegList_item_Callback";
4780 4845
4781 void operator[]=(int index, PathSeg value) { 4846 void operator[]=(int index, PathSeg value) {
4782 throw new UnsupportedError("Cannot assign element of immutable List."); 4847 throw new UnsupportedError("Cannot assign element of immutable List.");
4783 } 4848 }
4784 // -- start List<PathSeg> mixins. 4849 // -- start List<PathSeg> mixins.
4785 // PathSeg is the element type. 4850 // PathSeg is the element type.
4786 4851
4787 // SVG Collections expose numberOfItems rather than length. 4852 // SVG Collections expose numberOfItems rather than length.
4788 int get length => numberOfItems; 4853 int get length => numberOfItems;
4789 4854
4790 void set length(int value) { 4855 void set length(int value) {
4791 throw new UnsupportedError("Cannot resize immutable List."); 4856 throw new UnsupportedError("Cannot resize immutable List.");
4792 } 4857 }
4793 4858
4859 PathSeg get first {
4860 if (this.length > 0) {
4861 return this[0];
4862 }
4863 throw new StateError("No elements");
4864 }
4865
4866 PathSeg get last {
4867 int len = this.length;
4868 if (len > 0) {
4869 return this[len - 1];
4870 }
4871 throw new StateError("No elements");
4872 }
4873
4874 PathSeg get single {
4875 int len = this.length;
4876 if (len == 1) {
4877 return this[0];
4878 }
4879 if (len == 0) throw new StateError("No elements");
4880 throw new StateError("More than one element");
4881 }
4882
4883 PathSeg elementAt(int index) => this[index];
4794 // -- end List<PathSeg> mixins. 4884 // -- end List<PathSeg> mixins.
4795 4885
4796 @DomName('SVGPathSegList.appendItem') 4886 @DomName('SVGPathSegList.appendItem')
4797 @DocsEditable 4887 @DocsEditable
4798 PathSeg appendItem(PathSeg newItem) native "SVGPathSegList_appendItem_Callback "; 4888 PathSeg appendItem(PathSeg newItem) native "SVGPathSegList_appendItem_Callback ";
4799 4889
4800 @DomName('SVGPathSegList.clear') 4890 @DomName('SVGPathSegList.clear')
4801 @DocsEditable 4891 @DocsEditable
4802 void clear() native "SVGPathSegList_clear_Callback"; 4892 void clear() native "SVGPathSegList_clear_Callback";
4803 4893
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
5588 5678
5589 @DocsEditable 5679 @DocsEditable
5590 @DomName('SVGStringList') 5680 @DomName('SVGStringList')
5591 class StringList extends NativeFieldWrapperClass1 with ListMixin<String>, Immuta bleListMixin<String> implements List<String> { 5681 class StringList extends NativeFieldWrapperClass1 with ListMixin<String>, Immuta bleListMixin<String> implements List<String> {
5592 StringList.internal(); 5682 StringList.internal();
5593 5683
5594 @DomName('SVGStringList.numberOfItems') 5684 @DomName('SVGStringList.numberOfItems')
5595 @DocsEditable 5685 @DocsEditable
5596 int get numberOfItems native "SVGStringList_numberOfItems_Getter"; 5686 int get numberOfItems native "SVGStringList_numberOfItems_Getter";
5597 5687
5598 String operator[](int index) native "SVGStringList_item_Callback"; 5688 String operator[](int index) {
5689 if (index < 0 || index >= length)
5690 throw new RangeError.range(index, 0, length);
5691 return _nativeIndexedGetter(index);
5692 }
5693 String _nativeIndexedGetter(int index) native "SVGStringList_item_Callback";
5599 5694
5600 void operator[]=(int index, String value) { 5695 void operator[]=(int index, String value) {
5601 throw new UnsupportedError("Cannot assign element of immutable List."); 5696 throw new UnsupportedError("Cannot assign element of immutable List.");
5602 } 5697 }
5603 // -- start List<String> mixins. 5698 // -- start List<String> mixins.
5604 // String is the element type. 5699 // String is the element type.
5605 5700
5606 // SVG Collections expose numberOfItems rather than length. 5701 // SVG Collections expose numberOfItems rather than length.
5607 int get length => numberOfItems; 5702 int get length => numberOfItems;
5608 5703
5609 void set length(int value) { 5704 void set length(int value) {
5610 throw new UnsupportedError("Cannot resize immutable List."); 5705 throw new UnsupportedError("Cannot resize immutable List.");
5611 } 5706 }
5612 5707
5708 String get first {
5709 if (this.length > 0) {
5710 return this[0];
5711 }
5712 throw new StateError("No elements");
5713 }
5714
5715 String get last {
5716 int len = this.length;
5717 if (len > 0) {
5718 return this[len - 1];
5719 }
5720 throw new StateError("No elements");
5721 }
5722
5723 String get single {
5724 int len = this.length;
5725 if (len == 1) {
5726 return this[0];
5727 }
5728 if (len == 0) throw new StateError("No elements");
5729 throw new StateError("More than one element");
5730 }
5731
5732 String elementAt(int index) => this[index];
5613 // -- end List<String> mixins. 5733 // -- end List<String> mixins.
5614 5734
5615 @DomName('SVGStringList.appendItem') 5735 @DomName('SVGStringList.appendItem')
5616 @DocsEditable 5736 @DocsEditable
5617 String appendItem(String item) native "SVGStringList_appendItem_Callback"; 5737 String appendItem(String item) native "SVGStringList_appendItem_Callback";
5618 5738
5619 @DomName('SVGStringList.clear') 5739 @DomName('SVGStringList.clear')
5620 @DocsEditable 5740 @DocsEditable
5621 void clear() native "SVGStringList_clear_Callback"; 5741 void clear() native "SVGStringList_clear_Callback";
5622 5742
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
6672 6792
6673 @DocsEditable 6793 @DocsEditable
6674 @DomName('SVGTransformList') 6794 @DomName('SVGTransformList')
6675 class TransformList extends NativeFieldWrapperClass1 with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> { 6795 class TransformList extends NativeFieldWrapperClass1 with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> {
6676 TransformList.internal(); 6796 TransformList.internal();
6677 6797
6678 @DomName('SVGTransformList.numberOfItems') 6798 @DomName('SVGTransformList.numberOfItems')
6679 @DocsEditable 6799 @DocsEditable
6680 int get numberOfItems native "SVGTransformList_numberOfItems_Getter"; 6800 int get numberOfItems native "SVGTransformList_numberOfItems_Getter";
6681 6801
6682 Transform operator[](int index) native "SVGTransformList_item_Callback"; 6802 Transform operator[](int index) {
6803 if (index < 0 || index >= length)
6804 throw new RangeError.range(index, 0, length);
6805 return _nativeIndexedGetter(index);
6806 }
6807 Transform _nativeIndexedGetter(int index) native "SVGTransformList_item_Callba ck";
6683 6808
6684 void operator[]=(int index, Transform value) { 6809 void operator[]=(int index, Transform value) {
6685 throw new UnsupportedError("Cannot assign element of immutable List."); 6810 throw new UnsupportedError("Cannot assign element of immutable List.");
6686 } 6811 }
6687 // -- start List<Transform> mixins. 6812 // -- start List<Transform> mixins.
6688 // Transform is the element type. 6813 // Transform is the element type.
6689 6814
6690 // SVG Collections expose numberOfItems rather than length. 6815 // SVG Collections expose numberOfItems rather than length.
6691 int get length => numberOfItems; 6816 int get length => numberOfItems;
6692 6817
6693 void set length(int value) { 6818 void set length(int value) {
6694 throw new UnsupportedError("Cannot resize immutable List."); 6819 throw new UnsupportedError("Cannot resize immutable List.");
6695 } 6820 }
6696 6821
6822 Transform get first {
6823 if (this.length > 0) {
6824 return this[0];
6825 }
6826 throw new StateError("No elements");
6827 }
6828
6829 Transform get last {
6830 int len = this.length;
6831 if (len > 0) {
6832 return this[len - 1];
6833 }
6834 throw new StateError("No elements");
6835 }
6836
6837 Transform get single {
6838 int len = this.length;
6839 if (len == 1) {
6840 return this[0];
6841 }
6842 if (len == 0) throw new StateError("No elements");
6843 throw new StateError("More than one element");
6844 }
6845
6846 Transform elementAt(int index) => this[index];
6697 // -- end List<Transform> mixins. 6847 // -- end List<Transform> mixins.
6698 6848
6699 @DomName('SVGTransformList.appendItem') 6849 @DomName('SVGTransformList.appendItem')
6700 @DocsEditable 6850 @DocsEditable
6701 Transform appendItem(Transform item) native "SVGTransformList_appendItem_Callb ack"; 6851 Transform appendItem(Transform item) native "SVGTransformList_appendItem_Callb ack";
6702 6852
6703 @DomName('SVGTransformList.clear') 6853 @DomName('SVGTransformList.clear')
6704 @DocsEditable 6854 @DocsEditable
6705 void clear() native "SVGTransformList_clear_Callback"; 6855 void clear() native "SVGTransformList_clear_Callback";
6706 6856
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
7082 7232
7083 @DocsEditable 7233 @DocsEditable
7084 @DomName('SVGElementInstanceList') 7234 @DomName('SVGElementInstanceList')
7085 class _ElementInstanceList extends NativeFieldWrapperClass1 with ListMixin<Eleme ntInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance > { 7235 class _ElementInstanceList extends NativeFieldWrapperClass1 with ListMixin<Eleme ntInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance > {
7086 _ElementInstanceList.internal(); 7236 _ElementInstanceList.internal();
7087 7237
7088 @DomName('SVGElementInstanceList.length') 7238 @DomName('SVGElementInstanceList.length')
7089 @DocsEditable 7239 @DocsEditable
7090 int get length native "SVGElementInstanceList_length_Getter"; 7240 int get length native "SVGElementInstanceList_length_Getter";
7091 7241
7092 ElementInstance operator[](int index) native "SVGElementInstanceList_item_Call back"; 7242 ElementInstance operator[](int index) {
7243 if (index < 0 || index >= length)
7244 throw new RangeError.range(index, 0, length);
7245 return _nativeIndexedGetter(index);
7246 }
7247 ElementInstance _nativeIndexedGetter(int index) native "SVGElementInstanceList _item_Callback";
7093 7248
7094 void operator[]=(int index, ElementInstance value) { 7249 void operator[]=(int index, ElementInstance value) {
7095 throw new UnsupportedError("Cannot assign element of immutable List."); 7250 throw new UnsupportedError("Cannot assign element of immutable List.");
7096 } 7251 }
7097 // -- start List<ElementInstance> mixins. 7252 // -- start List<ElementInstance> mixins.
7098 // ElementInstance is the element type. 7253 // ElementInstance is the element type.
7099 7254
7100 7255
7101 void set length(int value) { 7256 void set length(int value) {
7102 throw new UnsupportedError("Cannot resize immutable List."); 7257 throw new UnsupportedError("Cannot resize immutable List.");
7103 } 7258 }
7104 7259
7260 ElementInstance get first {
7261 if (this.length > 0) {
7262 return this[0];
7263 }
7264 throw new StateError("No elements");
7265 }
7266
7267 ElementInstance get last {
7268 int len = this.length;
7269 if (len > 0) {
7270 return this[len - 1];
7271 }
7272 throw new StateError("No elements");
7273 }
7274
7275 ElementInstance get single {
7276 int len = this.length;
7277 if (len == 1) {
7278 return this[0];
7279 }
7280 if (len == 0) throw new StateError("No elements");
7281 throw new StateError("More than one element");
7282 }
7283
7284 ElementInstance elementAt(int index) => this[index];
7105 // -- end List<ElementInstance> mixins. 7285 // -- end List<ElementInstance> mixins.
7106 7286
7107 @DomName('SVGElementInstanceList.item') 7287 @DomName('SVGElementInstanceList.item')
7108 @DocsEditable 7288 @DocsEditable
7109 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback"; 7289 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback";
7110 7290
7111 } 7291 }
7112 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7292 // 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 7293 // 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. 7294 // 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 7622 @DocsEditable
7443 @DomName('SVGVKernElement') 7623 @DomName('SVGVKernElement')
7444 abstract class _SVGVKernElement extends SvgElement { 7624 abstract class _SVGVKernElement extends SvgElement {
7445 _SVGVKernElement.internal() : super.internal(); 7625 _SVGVKernElement.internal() : super.internal();
7446 7626
7447 @DomName('SVGVKernElement.SVGVKernElement') 7627 @DomName('SVGVKernElement.SVGVKernElement')
7448 @DocsEditable 7628 @DocsEditable
7449 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern"); 7629 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern");
7450 7630
7451 } 7631 }
OLDNEW
« no previous file with comments | « sdk/lib/svg/dart2js/svg_dart2js.dart ('k') | sdk/lib/web_sql/dart2js/web_sql_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698