OLD | NEW |
1 #library('dom'); | 1 #library('dom'); |
2 | 2 |
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 // DO NOT EDIT | 7 // DO NOT EDIT |
8 // Auto-generated Dart DOM library. | 8 // Auto-generated Dart DOM library. |
9 | 9 |
10 | 10 |
(...skipping 4235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4246 | 4246 |
4247 class _IDBKeyRangeJs extends _DOMTypeJs implements IDBKeyRange native "*IDBKeyRa
nge" { | 4247 class _IDBKeyRangeJs extends _DOMTypeJs implements IDBKeyRange native "*IDBKeyRa
nge" { |
4248 | 4248 |
4249 final lower; | 4249 final lower; |
4250 | 4250 |
4251 final bool lowerOpen; | 4251 final bool lowerOpen; |
4252 | 4252 |
4253 final upper; | 4253 final upper; |
4254 | 4254 |
4255 final bool upperOpen; | 4255 final bool upperOpen; |
4256 | |
4257 _IDBKeyRangeJs bound(lower, upper, [bool lowerOpen = null, bool upperOpen = nu
ll]) native; | |
4258 | |
4259 _IDBKeyRangeJs lowerBound(bound, [bool open = null]) native; | |
4260 | |
4261 _IDBKeyRangeJs only(value) native; | |
4262 | |
4263 _IDBKeyRangeJs upperBound(bound, [bool open = null]) native; | |
4264 } | 4256 } |
4265 | 4257 |
4266 class _IDBObjectStoreJs extends _DOMTypeJs implements IDBObjectStore native "*ID
BObjectStore" { | 4258 class _IDBObjectStoreJs extends _DOMTypeJs implements IDBObjectStore native "*ID
BObjectStore" { |
4267 | 4259 |
4268 final List<String> indexNames; | 4260 final List<String> indexNames; |
4269 | 4261 |
4270 final String keyPath; | 4262 final String keyPath; |
4271 | 4263 |
4272 final String name; | 4264 final String name; |
4273 | 4265 |
(...skipping 12871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17145 // WARNING: Do not edit - generated code. | 17137 // WARNING: Do not edit - generated code. |
17146 | 17138 |
17147 interface IDBKey { | 17139 interface IDBKey { |
17148 } | 17140 } |
17149 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 17141 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
17150 // for details. All rights reserved. Use of this source code is governed by a | 17142 // for details. All rights reserved. Use of this source code is governed by a |
17151 // BSD-style license that can be found in the LICENSE file. | 17143 // BSD-style license that can be found in the LICENSE file. |
17152 | 17144 |
17153 // WARNING: Do not edit - generated code. | 17145 // WARNING: Do not edit - generated code. |
17154 | 17146 |
17155 interface IDBKeyRange { | 17147 interface IDBKeyRange default _IDBKeyRangeFactoryProvider { |
| 17148 |
| 17149 IDBKeyRange.only(/*IDBKey*/ value); |
| 17150 |
| 17151 IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open]); |
| 17152 |
| 17153 IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open]); |
| 17154 |
| 17155 IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, |
| 17156 [bool lowerOpen, bool upperOpen]); |
| 17157 |
17156 | 17158 |
17157 final /*IDBKey*/ lower; | 17159 final /*IDBKey*/ lower; |
17158 | 17160 |
17159 final bool lowerOpen; | 17161 final bool lowerOpen; |
17160 | 17162 |
17161 final /*IDBKey*/ upper; | 17163 final /*IDBKey*/ upper; |
17162 | 17164 |
17163 final bool upperOpen; | 17165 final bool upperOpen; |
17164 | |
17165 IDBKeyRange bound(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bool up
perOpen]); | |
17166 | |
17167 IDBKeyRange lowerBound(/*IDBKey*/ bound, [bool open]); | |
17168 | |
17169 IDBKeyRange only(/*IDBKey*/ value); | |
17170 | |
17171 IDBKeyRange upperBound(/*IDBKey*/ bound, [bool open]); | |
17172 } | 17166 } |
17173 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 17167 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
17174 // for details. All rights reserved. Use of this source code is governed by a | 17168 // for details. All rights reserved. Use of this source code is governed by a |
17175 // BSD-style license that can be found in the LICENSE file. | 17169 // BSD-style license that can be found in the LICENSE file. |
17176 | 17170 |
17177 // WARNING: Do not edit - generated code. | 17171 // WARNING: Do not edit - generated code. |
17178 | 17172 |
17179 interface IDBObjectStore { | 17173 interface IDBObjectStore { |
17180 | 17174 |
17181 final List<String> indexNames; | 17175 final List<String> indexNames; |
(...skipping 7605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24787 * Indicates the document is finished parsing but is still loading | 24781 * Indicates the document is finished parsing but is still loading |
24788 * subresources. | 24782 * subresources. |
24789 */ | 24783 */ |
24790 static final String INTERACTIVE = "interactive"; | 24784 static final String INTERACTIVE = "interactive"; |
24791 | 24785 |
24792 /** | 24786 /** |
24793 * Indicates the document and all subresources have been loaded. | 24787 * Indicates the document and all subresources have been loaded. |
24794 */ | 24788 */ |
24795 static final String COMPLETE = "complete"; | 24789 static final String COMPLETE = "complete"; |
24796 } | 24790 } |
24797 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
24798 // for details. All rights reserved. Use of this source code is governed by a | |
24799 // BSD-style license that can be found in the LICENSE file. | |
24800 | |
24801 /** | |
24802 * The [Collections] class implements static methods useful when | |
24803 * writing a class that implements [Collection] and the [iterator] | |
24804 * method. | |
24805 */ | |
24806 class _Collections { | |
24807 static void forEach(Iterable<Object> iterable, void f(Object o)) { | |
24808 for (final e in iterable) { | |
24809 f(e); | |
24810 } | |
24811 } | |
24812 | |
24813 static List map(Iterable<Object> source, | |
24814 List<Object> destination, | |
24815 f(o)) { | |
24816 for (final e in source) { | |
24817 destination.add(f(e)); | |
24818 } | |
24819 return destination; | |
24820 } | |
24821 | |
24822 static bool some(Iterable<Object> iterable, bool f(Object o)) { | |
24823 for (final e in iterable) { | |
24824 if (f(e)) return true; | |
24825 } | |
24826 return false; | |
24827 } | |
24828 | |
24829 static bool every(Iterable<Object> iterable, bool f(Object o)) { | |
24830 for (final e in iterable) { | |
24831 if (!f(e)) return false; | |
24832 } | |
24833 return true; | |
24834 } | |
24835 | |
24836 static List filter(Iterable<Object> source, | |
24837 List<Object> destination, | |
24838 bool f(o)) { | |
24839 for (final e in source) { | |
24840 if (f(e)) destination.add(e); | |
24841 } | |
24842 return destination; | |
24843 } | |
24844 | |
24845 static bool isEmpty(Iterable<Object> iterable) { | |
24846 return !iterable.iterator().hasNext(); | |
24847 } | |
24848 } | |
24849 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24791 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
24850 // for details. All rights reserved. Use of this source code is governed by a | 24792 // for details. All rights reserved. Use of this source code is governed by a |
24851 // BSD-style license that can be found in the LICENSE file. | 24793 // BSD-style license that can be found in the LICENSE file. |
24852 | 24794 |
24853 // TODO(vsm): Unify with Dartium version. | 24795 // TODO(vsm): Unify with Dartium version. |
24854 class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { | 24796 class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { |
24855 // Private window. | 24797 // Private window. |
24856 _DOMWindowJs _window; | 24798 _DOMWindowJs _window; |
24857 | 24799 |
24858 // DOMType | 24800 // DOMType |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24935 } | 24877 } |
24936 | 24878 |
24937 class _WebSocketFactoryProvider { | 24879 class _WebSocketFactoryProvider { |
24938 | 24880 |
24939 factory WebSocket(String url) native '''return new WebSocket(url);'''; | 24881 factory WebSocket(String url) native '''return new WebSocket(url);'''; |
24940 } | 24882 } |
24941 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24883 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
24942 // for details. All rights reserved. Use of this source code is governed by a | 24884 // for details. All rights reserved. Use of this source code is governed by a |
24943 // BSD-style license that can be found in the LICENSE file. | 24885 // BSD-style license that can be found in the LICENSE file. |
24944 | 24886 |
| 24887 class _IDBKeyRangeFactoryProvider { |
| 24888 |
| 24889 factory IDBKeyRange.only(/*IDBKey*/ value) => |
| 24890 _only(_class(), _translateKey(value)); |
| 24891 |
| 24892 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) => |
| 24893 _lowerBound(_class(), _translateKey(bound), open); |
| 24894 |
| 24895 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) => |
| 24896 _upperBound(_class(), _translateKey(bound), open); |
| 24897 |
| 24898 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, |
| 24899 [bool lowerOpen = false, bool upperOpen = false]) => |
| 24900 _bound(_class(), _translateKey(lower), _translateKey(upper), |
| 24901 lowerOpen, upperOpen); |
| 24902 |
| 24903 static var _cachedClass; |
| 24904 |
| 24905 static _class() { |
| 24906 if (_cachedClass != null) return _cachedClass; |
| 24907 return _cachedClass = _uncachedClass(); |
| 24908 } |
| 24909 |
| 24910 static _uncachedClass() native ''' |
| 24911 return window.webkitIDBKeyRange || window.mozIDBKeyRange || |
| 24912 window.msIDBKeyRange || window.IDBKeyRange; |
| 24913 '''; |
| 24914 |
| 24915 static _translateKey(idbkey) => idbkey; // TODO: fixme. |
| 24916 |
| 24917 static _IDBKeyRangeJs _only(cls, value) native |
| 24918 '''return cls.only(value);'''; |
| 24919 |
| 24920 static _IDBKeyRangeJs _lowerBound(cls, bound, open) native |
| 24921 '''return cls.lowerBound(bound, open);'''; |
| 24922 |
| 24923 static _IDBKeyRangeJs _upperBound(cls, bound, open) native |
| 24924 '''return cls.upperBound(bound, open);'''; |
| 24925 |
| 24926 static _IDBKeyRangeJs _bound(cls, lower, upper, lowerOpen, upperOpen) native |
| 24927 '''return cls.bound(lower, upper, lowerOpen, upperOpen);'''; |
| 24928 |
| 24929 } |
| 24930 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24931 // for details. All rights reserved. Use of this source code is governed by a |
| 24932 // BSD-style license that can be found in the LICENSE file. |
| 24933 |
24945 class _TypedArrayFactoryProvider { | 24934 class _TypedArrayFactoryProvider { |
24946 | 24935 |
24947 factory Float32Array(int length) => _F32(length); | 24936 factory Float32Array(int length) => _F32(length); |
24948 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); | 24937 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); |
24949 factory Float32Array.fromBuffer(ArrayBuffer buffer, | 24938 factory Float32Array.fromBuffer(ArrayBuffer buffer, |
24950 [int byteOffset = 0, int length]) { | 24939 [int byteOffset = 0, int length]) { |
24951 if (length == null) return _F32_2(buffer, byteOffset); | 24940 if (length == null) return _F32_2(buffer, byteOffset); |
24952 return _F32_3(buffer, byteOffset, length); | 24941 return _F32_3(buffer, byteOffset, length); |
24953 } | 24942 } |
24954 | 24943 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
25048 | 25037 |
25049 | 25038 |
25050 // Ensures that [list] is a JavaScript Array or a typed array. If necessary, | 25039 // Ensures that [list] is a JavaScript Array or a typed array. If necessary, |
25051 // copies the list. | 25040 // copies the list. |
25052 static ensureNative(List list) => list; // TODO: make sure. | 25041 static ensureNative(List list) => list; // TODO: make sure. |
25053 } | 25042 } |
25054 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 25043 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
25055 // for details. All rights reserved. Use of this source code is governed by a | 25044 // for details. All rights reserved. Use of this source code is governed by a |
25056 // BSD-style license that can be found in the LICENSE file. | 25045 // BSD-style license that can be found in the LICENSE file. |
25057 | 25046 |
| 25047 /** |
| 25048 * The [Collections] class implements static methods useful when |
| 25049 * writing a class that implements [Collection] and the [iterator] |
| 25050 * method. |
| 25051 */ |
| 25052 class _Collections { |
| 25053 static void forEach(Iterable<Object> iterable, void f(Object o)) { |
| 25054 for (final e in iterable) { |
| 25055 f(e); |
| 25056 } |
| 25057 } |
| 25058 |
| 25059 static List map(Iterable<Object> source, |
| 25060 List<Object> destination, |
| 25061 f(o)) { |
| 25062 for (final e in source) { |
| 25063 destination.add(f(e)); |
| 25064 } |
| 25065 return destination; |
| 25066 } |
| 25067 |
| 25068 static bool some(Iterable<Object> iterable, bool f(Object o)) { |
| 25069 for (final e in iterable) { |
| 25070 if (f(e)) return true; |
| 25071 } |
| 25072 return false; |
| 25073 } |
| 25074 |
| 25075 static bool every(Iterable<Object> iterable, bool f(Object o)) { |
| 25076 for (final e in iterable) { |
| 25077 if (!f(e)) return false; |
| 25078 } |
| 25079 return true; |
| 25080 } |
| 25081 |
| 25082 static List filter(Iterable<Object> source, |
| 25083 List<Object> destination, |
| 25084 bool f(o)) { |
| 25085 for (final e in source) { |
| 25086 if (f(e)) destination.add(e); |
| 25087 } |
| 25088 return destination; |
| 25089 } |
| 25090 |
| 25091 static bool isEmpty(Iterable<Object> iterable) { |
| 25092 return !iterable.iterator().hasNext(); |
| 25093 } |
| 25094 } |
| 25095 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 25096 // for details. All rights reserved. Use of this source code is governed by a |
| 25097 // BSD-style license that can be found in the LICENSE file. |
| 25098 |
25058 // Iterator for arrays with fixed size. | 25099 // Iterator for arrays with fixed size. |
25059 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { | 25100 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { |
25060 _FixedSizeListIterator(List<T> array) | 25101 _FixedSizeListIterator(List<T> array) |
25061 : super(array), | 25102 : super(array), |
25062 _length = array.length; | 25103 _length = array.length; |
25063 | 25104 |
25064 bool hasNext() => _length > _pos; | 25105 bool hasNext() => _length > _pos; |
25065 | 25106 |
25066 final int _length; // Cache array length for faster access. | 25107 final int _length; // Cache array length for faster access. |
25067 } | 25108 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
25145 if (length < 0) throw new IllegalArgumentException('length'); | 25186 if (length < 0) throw new IllegalArgumentException('length'); |
25146 if (start < 0) throw new IndexOutOfRangeException(start); | 25187 if (start < 0) throw new IndexOutOfRangeException(start); |
25147 int end = start + length; | 25188 int end = start + length; |
25148 if (end > a.length) throw new IndexOutOfRangeException(end); | 25189 if (end > a.length) throw new IndexOutOfRangeException(end); |
25149 for (int i = start; i < end; i++) { | 25190 for (int i = start; i < end; i++) { |
25150 accumulator.add(a[i]); | 25191 accumulator.add(a[i]); |
25151 } | 25192 } |
25152 return accumulator; | 25193 return accumulator; |
25153 } | 25194 } |
25154 } | 25195 } |
OLD | NEW |