| OLD | NEW |
| 1 library html; | 1 library html; |
| 2 | 2 |
| 3 import 'dart:isolate'; | 3 import 'dart:isolate'; |
| 4 import 'dart:json'; | 4 import 'dart:json'; |
| 5 import 'dart:svg' as svg; | 5 import 'dart:svg' as svg; |
| 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 7 // for details. All rights reserved. Use of this source code is governed by a | 7 // for details. All rights reserved. Use of this source code is governed by a |
| 8 // BSD-style license that can be found in the LICENSE file. | 8 // BSD-style license that can be found in the LICENSE file. |
| 9 | 9 |
| 10 // DO NOT EDIT | 10 // DO NOT EDIT |
| (...skipping 22022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22033 | 22033 |
| 22034 abstract class History { | 22034 abstract class History { |
| 22035 void back(); | 22035 void back(); |
| 22036 void forward(); | 22036 void forward(); |
| 22037 void go(int distance); | 22037 void go(int distance); |
| 22038 } | 22038 } |
| 22039 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 22039 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 22040 // for details. All rights reserved. Use of this source code is governed by a | 22040 // for details. All rights reserved. Use of this source code is governed by a |
| 22041 // BSD-style license that can be found in the LICENSE file. | 22041 // BSD-style license that can be found in the LICENSE file. |
| 22042 | 22042 |
| 22043 |
| 22043 abstract class CssClassSet implements Set<String> { | 22044 abstract class CssClassSet implements Set<String> { |
| 22044 | 22045 |
| 22045 String toString() { | 22046 String toString() { |
| 22046 return Strings.join(new List.from(readClasses()), ' '); | 22047 return Strings.join(new List.from(readClasses()), ' '); |
| 22047 } | 22048 } |
| 22048 | 22049 |
| 22049 /** | 22050 /** |
| 22050 * Adds the class [token] to the element if it is not on it, removes it if it | 22051 * Adds the class [token] to the element if it is not on it, removes it if it |
| 22051 * is. | 22052 * is. |
| 22052 */ | 22053 */ |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22198 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 22199 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 22199 // for details. All rights reserved. Use of this source code is governed by a | 22200 // for details. All rights reserved. Use of this source code is governed by a |
| 22200 // BSD-style license that can be found in the LICENSE file. | 22201 // BSD-style license that can be found in the LICENSE file. |
| 22201 | 22202 |
| 22202 | 22203 |
| 22203 typedef void EventListener(Event event); | 22204 typedef void EventListener(Event event); |
| 22204 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 22205 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 22205 // for details. All rights reserved. Use of this source code is governed by a | 22206 // for details. All rights reserved. Use of this source code is governed by a |
| 22206 // BSD-style license that can be found in the LICENSE file. | 22207 // BSD-style license that can be found in the LICENSE file. |
| 22207 | 22208 |
| 22209 |
| 22208 class FilteredElementList implements List { | 22210 class FilteredElementList implements List { |
| 22209 final Node _node; | 22211 final Node _node; |
| 22210 final List<Node> _childNodes; | 22212 final List<Node> _childNodes; |
| 22211 | 22213 |
| 22212 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; | 22214 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; |
| 22213 | 22215 |
| 22214 // We can't memoize this, since it's possible that children will be messed | 22216 // We can't memoize this, since it's possible that children will be messed |
| 22215 // with externally to this class. | 22217 // with externally to this class. |
| 22216 // | 22218 // |
| 22217 // TODO(nweiz): Do we really need to copy the list to make the types work out? | 22219 // TODO(nweiz): Do we really need to copy the list to make the types work out? |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23902 | 23904 |
| 23903 // What is required is to ensure that an Lists in the key are actually | 23905 // What is required is to ensure that an Lists in the key are actually |
| 23904 // JavaScript arrays, and any Dates are JavaScript Dates. | 23906 // JavaScript arrays, and any Dates are JavaScript Dates. |
| 23905 | 23907 |
| 23906 // Conversions for Window. These check if the window is the local | 23908 // Conversions for Window. These check if the window is the local |
| 23907 // window, and if it's not, wraps or unwraps it with a secure wrapper. | 23909 // window, and if it's not, wraps or unwraps it with a secure wrapper. |
| 23908 // We need to test for EventTarget here as well as it's a base type. | 23910 // We need to test for EventTarget here as well as it's a base type. |
| 23909 // We omit an unwrapper for Window as no methods take a non-local | 23911 // We omit an unwrapper for Window as no methods take a non-local |
| 23910 // window as a parameter. | 23912 // window as a parameter. |
| 23911 | 23913 |
| 23914 |
| 23912 Window _convertNativeToDart_Window(win) { | 23915 Window _convertNativeToDart_Window(win) { |
| 23913 return _DOMWindowCrossFrame._createSafe(win); | 23916 return _DOMWindowCrossFrame._createSafe(win); |
| 23914 } | 23917 } |
| 23915 | 23918 |
| 23916 EventTarget _convertNativeToDart_EventTarget(e) { | 23919 EventTarget _convertNativeToDart_EventTarget(e) { |
| 23917 // Assume it's a Window if it contains the setInterval property. It may be | 23920 // Assume it's a Window if it contains the setInterval property. It may be |
| 23918 // from a different frame - without a patched prototype - so we cannot | 23921 // from a different frame - without a patched prototype - so we cannot |
| 23919 // rely on Dart type checking. | 23922 // rely on Dart type checking. |
| 23920 if (JS('bool', r'"setInterval" in #', e)) | 23923 if (JS('bool', r'"setInterval" in #', e)) |
| 23921 return _DOMWindowCrossFrame._createSafe(e); | 23924 return _DOMWindowCrossFrame._createSafe(e); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24311 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); | 24314 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); |
| 24312 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); | 24315 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); |
| 24313 bool _isJavaScriptSimpleObject(value) => | 24316 bool _isJavaScriptSimpleObject(value) => |
| 24314 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); | 24317 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); |
| 24315 bool _isImmutableJavaScriptArray(value) => | 24318 bool _isImmutableJavaScriptArray(value) => |
| 24316 JS('bool', r'!!(#.immutable$list)', value); | 24319 JS('bool', r'!!(#.immutable$list)', value); |
| 24317 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24320 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24318 // for details. All rights reserved. Use of this source code is governed by a | 24321 // for details. All rights reserved. Use of this source code is governed by a |
| 24319 // BSD-style license that can be found in the LICENSE file. | 24322 // BSD-style license that can be found in the LICENSE file. |
| 24320 | 24323 |
| 24324 |
| 24321 // TODO(vsm): Unify with Dartium version. | 24325 // TODO(vsm): Unify with Dartium version. |
| 24322 class _DOMWindowCrossFrame implements Window { | 24326 class _DOMWindowCrossFrame implements Window { |
| 24323 // Private window. Note, this is a window in another frame, so it | 24327 // Private window. Note, this is a window in another frame, so it |
| 24324 // cannot be typed as "Window" as its prototype is not patched | 24328 // cannot be typed as "Window" as its prototype is not patched |
| 24325 // properly. Its fields and methods can only be accessed via JavaScript. | 24329 // properly. Its fields and methods can only be accessed via JavaScript. |
| 24326 var _window; | 24330 var _window; |
| 24327 | 24331 |
| 24328 // Fields. | 24332 // Fields. |
| 24329 History get history => | 24333 History get history => |
| 24330 _HistoryCrossFrame._createSafe(JS('History', '#.history', _window)); | 24334 _HistoryCrossFrame._createSafe(JS('History', '#.history', _window)); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24414 } else { | 24418 } else { |
| 24415 // TODO(vsm): Cache or implement equality. | 24419 // TODO(vsm): Cache or implement equality. |
| 24416 return new _HistoryCrossFrame(h); | 24420 return new _HistoryCrossFrame(h); |
| 24417 } | 24421 } |
| 24418 } | 24422 } |
| 24419 } | 24423 } |
| 24420 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24424 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24421 // for details. All rights reserved. Use of this source code is governed by a | 24425 // for details. All rights reserved. Use of this source code is governed by a |
| 24422 // BSD-style license that can be found in the LICENSE file. | 24426 // BSD-style license that can be found in the LICENSE file. |
| 24423 | 24427 |
| 24428 |
| 24424 class _AudioContextFactoryProvider { | 24429 class _AudioContextFactoryProvider { |
| 24425 | 24430 |
| 24426 static AudioContext createAudioContext() { | 24431 static AudioContext createAudioContext() { |
| 24427 return JS('AudioContext', | 24432 return JS('AudioContext', |
| 24428 'new (window.AudioContext || window.webkitAudioContext)()'); | 24433 'new (window.AudioContext || window.webkitAudioContext)()'); |
| 24429 } | 24434 } |
| 24430 } | 24435 } |
| 24431 | 24436 |
| 24432 class _PointFactoryProvider { | 24437 class _PointFactoryProvider { |
| 24433 static Point createPoint(num x, num y) => | 24438 static Point createPoint(num x, num y) => |
| 24434 JS('Point', 'new WebKitPoint(#, #)', x, y); | 24439 JS('Point', 'new WebKitPoint(#, #)', x, y); |
| 24435 } | 24440 } |
| 24436 | 24441 |
| 24437 class _WebSocketFactoryProvider { | 24442 class _WebSocketFactoryProvider { |
| 24438 static WebSocket createWebSocket(String url) => | 24443 static WebSocket createWebSocket(String url) => |
| 24439 JS('WebSocket', 'new WebSocket(#)', url); | 24444 JS('WebSocket', 'new WebSocket(#)', url); |
| 24440 } | 24445 } |
| 24441 | 24446 |
| 24442 class _TextFactoryProvider { | 24447 class _TextFactoryProvider { |
| 24443 static Text createText(String data) => | 24448 static Text createText(String data) => |
| 24444 JS('Text', 'document.createTextNode(#)', data); | 24449 JS('Text', 'document.createTextNode(#)', data); |
| 24445 } | 24450 } |
| 24446 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24451 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24447 // for details. All rights reserved. Use of this source code is governed by a | 24452 // for details. All rights reserved. Use of this source code is governed by a |
| 24448 // BSD-style license that can be found in the LICENSE file. | 24453 // BSD-style license that can be found in the LICENSE file. |
| 24449 | 24454 |
| 24455 |
| 24450 class _IDBKeyRangeFactoryProvider { | 24456 class _IDBKeyRangeFactoryProvider { |
| 24451 | 24457 |
| 24452 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) => | 24458 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) => |
| 24453 _only(_class(), _translateKey(value)); | 24459 _only(_class(), _translateKey(value)); |
| 24454 | 24460 |
| 24455 static IDBKeyRange createIDBKeyRange_lowerBound( | 24461 static IDBKeyRange createIDBKeyRange_lowerBound( |
| 24456 /*IDBKey*/ bound, [bool open = false]) => | 24462 /*IDBKey*/ bound, [bool open = false]) => |
| 24457 _lowerBound(_class(), _translateKey(bound), open); | 24463 _lowerBound(_class(), _translateKey(bound), open); |
| 24458 | 24464 |
| 24459 static IDBKeyRange createIDBKeyRange_upperBound( | 24465 static IDBKeyRange createIDBKeyRange_upperBound( |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24572 String toString() => JS('String', '#.toString()', _ptr); | 24578 String toString() => JS('String', '#.toString()', _ptr); |
| 24573 | 24579 |
| 24574 | 24580 |
| 24575 static _get(p, m) => JS('var', '#[#]', p, m); | 24581 static _get(p, m) => JS('var', '#[#]', p, m); |
| 24576 static _set(p, m, v) => JS('void', '#[#] = #', p, m, v); | 24582 static _set(p, m, v) => JS('void', '#[#] = #', p, m, v); |
| 24577 } | 24583 } |
| 24578 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24584 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24579 // for details. All rights reserved. Use of this source code is governed by a | 24585 // for details. All rights reserved. Use of this source code is governed by a |
| 24580 // BSD-style license that can be found in the LICENSE file. | 24586 // BSD-style license that can be found in the LICENSE file. |
| 24581 | 24587 |
| 24588 |
| 24582 /** | 24589 /** |
| 24583 * Checks to see if the mutation observer API is supported on the current | 24590 * Checks to see if the mutation observer API is supported on the current |
| 24584 * platform. | 24591 * platform. |
| 24585 */ | 24592 */ |
| 24586 bool _isMutationObserverSupported() => | 24593 bool _isMutationObserverSupported() => |
| 24587 JS('bool', '!!(window.MutationObserver || window.WebKitMutationObserver)'); | 24594 JS('bool', '!!(window.MutationObserver || window.WebKitMutationObserver)'); |
| 24588 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 24595 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24589 // for details. All rights reserved. Use of this source code is governed by a | 24596 // for details. All rights reserved. Use of this source code is governed by a |
| 24590 // BSD-style license that can be found in the LICENSE file. | 24597 // BSD-style license that can be found in the LICENSE file. |
| 24591 | 24598 |
| 24599 |
| 24592 class _TypedArrayFactoryProvider { | 24600 class _TypedArrayFactoryProvider { |
| 24593 | 24601 |
| 24594 static Float32Array createFloat32Array(int length) => _F32(length); | 24602 static Float32Array createFloat32Array(int length) => _F32(length); |
| 24595 static Float32Array createFloat32Array_fromList(List<num> list) => | 24603 static Float32Array createFloat32Array_fromList(List<num> list) => |
| 24596 _F32(ensureNative(list)); | 24604 _F32(ensureNative(list)); |
| 24597 static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer, | 24605 static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer, |
| 24598 [int byteOffset = 0, int length]) { | 24606 [int byteOffset = 0, int length]) { |
| 24599 if (length == null) return _F32_2(buffer, byteOffset); | 24607 if (length == null) return _F32_2(buffer, byteOffset); |
| 24600 return _F32_3(buffer, byteOffset, length); | 24608 return _F32_3(buffer, byteOffset, length); |
| 24601 } | 24609 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24849 if (length < 0) throw new ArgumentError('length'); | 24857 if (length < 0) throw new ArgumentError('length'); |
| 24850 if (start < 0) throw new RangeError.value(start); | 24858 if (start < 0) throw new RangeError.value(start); |
| 24851 int end = start + length; | 24859 int end = start + length; |
| 24852 if (end > a.length) throw new RangeError.value(end); | 24860 if (end > a.length) throw new RangeError.value(end); |
| 24853 for (int i = start; i < end; i++) { | 24861 for (int i = start; i < end; i++) { |
| 24854 accumulator.add(a[i]); | 24862 accumulator.add(a[i]); |
| 24855 } | 24863 } |
| 24856 return accumulator; | 24864 return accumulator; |
| 24857 } | 24865 } |
| 24858 } | 24866 } |
| OLD | NEW |