| OLD | NEW |
| 1 library html; | 1 library html; |
| 2 | 2 |
| 3 import 'dart:collection'; | 3 import 'dart:collection'; |
| 4 import 'dart:html_common'; | 4 import 'dart:html_common'; |
| 5 import 'dart:indexed_db'; | 5 import 'dart:indexed_db'; |
| 6 import 'dart:isolate'; | 6 import 'dart:isolate'; |
| 7 import 'dart:json'; | 7 import 'dart:json'; |
| 8 import 'dart:svg' as svg; | 8 import 'dart:svg' as svg; |
| 9 import 'dart:web_audio' as web_audio; | 9 import 'dart:web_audio' as web_audio; |
| 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 11 // for details. All rights reserved. Use of this source code is governed by a | 11 // for details. All rights reserved. Use of this source code is governed by a |
| 12 // BSD-style license that can be found in the LICENSE file. | 12 // BSD-style license that can be found in the LICENSE file. |
| 13 | 13 |
| 14 // DO NOT EDIT | 14 // DO NOT EDIT |
| 15 // Auto-generated dart:html library. | 15 // Auto-generated dart:html library. |
| 16 | 16 |
| 17 | 17 |
| 18 // Not actually used, but imported since dart:html can generate these objects. | 18 // Not actually used, but imported since dart:html can generate these objects. |
| 19 | 19 |
| 20 | 20 |
| 21 | 21 |
| 22 | 22 |
| 23 | 23 |
| 24 LocalWindow get window => JS('LocalWindow', 'window'); | 24 Window get window => JS('Window', 'window'); |
| 25 | 25 |
| 26 HtmlDocument get document => JS('Document', 'document'); | 26 HtmlDocument get document => JS('Document', 'document'); |
| 27 | 27 |
| 28 Element query(String selector) => document.query(selector); | 28 Element query(String selector) => document.query(selector); |
| 29 List<Element> queryAll(String selector) => document.queryAll(selector); | 29 List<Element> queryAll(String selector) => document.queryAll(selector); |
| 30 | 30 |
| 31 // Workaround for tags like <cite> that lack their own Element subclass -- | 31 // Workaround for tags like <cite> that lack their own Element subclass -- |
| 32 // Dart issue 1990. | 32 // Dart issue 1990. |
| 33 class _HTMLElement extends Element native "*HTMLElement" { | 33 class _HTMLElement extends Element native "*HTMLElement" { |
| 34 } | 34 } |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 // BSD-style license that can be found in the LICENSE file. | 1372 // BSD-style license that can be found in the LICENSE file. |
| 1373 | 1373 |
| 1374 | 1374 |
| 1375 /// @domName CompositionEvent; @docsEditable true | 1375 /// @domName CompositionEvent; @docsEditable true |
| 1376 class CompositionEvent extends UIEvent native "*CompositionEvent" { | 1376 class CompositionEvent extends UIEvent native "*CompositionEvent" { |
| 1377 | 1377 |
| 1378 /// @domName CompositionEvent.data; @docsEditable true | 1378 /// @domName CompositionEvent.data; @docsEditable true |
| 1379 final String data; | 1379 final String data; |
| 1380 | 1380 |
| 1381 /// @domName CompositionEvent.initCompositionEvent; @docsEditable true | 1381 /// @domName CompositionEvent.initCompositionEvent; @docsEditable true |
| 1382 void initCompositionEvent(String typeArg, bool canBubbleArg, bool cancelableAr
g, LocalWindow viewArg, String dataArg) native; | 1382 void initCompositionEvent(String typeArg, bool canBubbleArg, bool cancelableAr
g, Window viewArg, String dataArg) native; |
| 1383 } | 1383 } |
| 1384 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1384 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1385 // for details. All rights reserved. Use of this source code is governed by a | 1385 // for details. All rights reserved. Use of this source code is governed by a |
| 1386 // BSD-style license that can be found in the LICENSE file. | 1386 // BSD-style license that can be found in the LICENSE file. |
| 1387 | 1387 |
| 1388 | 1388 |
| 1389 /// @domName Console | 1389 /// @domName Console |
| 1390 class Console { | 1390 class Console { |
| 1391 | 1391 |
| 1392 static Console safeConsole = new Console(); | 1392 static Console safeConsole = new Console(); |
| (...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5753 /// @domName Document.body; @docsEditable true | 5753 /// @domName Document.body; @docsEditable true |
| 5754 @JSName('body') | 5754 @JSName('body') |
| 5755 Element $dom_body; | 5755 Element $dom_body; |
| 5756 | 5756 |
| 5757 /// @domName Document.charset; @docsEditable true | 5757 /// @domName Document.charset; @docsEditable true |
| 5758 String charset; | 5758 String charset; |
| 5759 | 5759 |
| 5760 /// @domName Document.cookie; @docsEditable true | 5760 /// @domName Document.cookie; @docsEditable true |
| 5761 String cookie; | 5761 String cookie; |
| 5762 | 5762 |
| 5763 /// Returns the [Window] associated with the document. | |
| 5764 /// @domName Document.defaultView; @docsEditable true | 5763 /// @domName Document.defaultView; @docsEditable true |
| 5765 Window get window => _convertNativeToDart_Window(this._window); | 5764 WindowBase get window => _convertNativeToDart_Window(this._window); |
| 5766 @JSName('defaultView') | 5765 @JSName('defaultView') |
| 5767 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 5766 @Creates('Window|=Object') @Returns('Window|=Object') |
| 5768 final dynamic _window; | 5767 final dynamic _window; |
| 5769 | 5768 |
| 5770 /// @domName Document.documentElement; @docsEditable true | 5769 /// @domName Document.documentElement; @docsEditable true |
| 5771 final Element documentElement; | 5770 final Element documentElement; |
| 5772 | 5771 |
| 5773 /// @domName Document.domain; @docsEditable true | 5772 /// @domName Document.domain; @docsEditable true |
| 5774 final String domain; | 5773 final String domain; |
| 5775 | 5774 |
| 5776 /// Moved to [HtmlDocument]. | 5775 /// Moved to [HtmlDocument]. |
| 5777 /// @domName Document.head; @docsEditable true | 5776 /// @domName Document.head; @docsEditable true |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5870 | 5869 |
| 5871 /// @domName Document.createRange; @docsEditable true | 5870 /// @domName Document.createRange; @docsEditable true |
| 5872 @JSName('createRange') | 5871 @JSName('createRange') |
| 5873 Range $dom_createRange() native; | 5872 Range $dom_createRange() native; |
| 5874 | 5873 |
| 5875 /// @domName Document.createTextNode; @docsEditable true | 5874 /// @domName Document.createTextNode; @docsEditable true |
| 5876 @JSName('createTextNode') | 5875 @JSName('createTextNode') |
| 5877 Text $dom_createTextNode(String data) native; | 5876 Text $dom_createTextNode(String data) native; |
| 5878 | 5877 |
| 5879 /// @domName Document.createTouch; @docsEditable true | 5878 /// @domName Document.createTouch; @docsEditable true |
| 5880 Touch $dom_createTouch(LocalWindow window, EventTarget target, int identifier,
int pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRa
diusY, num webkitRotationAngle, num webkitForce) { | 5879 Touch $dom_createTouch(Window window, EventTarget target, int identifier, int
pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRadiusY
, num webkitRotationAngle, num webkitForce) { |
| 5881 var target_1 = _convertDartToNative_EventTarget(target); | 5880 var target_1 = _convertDartToNative_EventTarget(target); |
| 5882 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree
nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce); | 5881 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree
nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce); |
| 5883 } | 5882 } |
| 5884 @JSName('createTouch') | 5883 @JSName('createTouch') |
| 5885 Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY
, screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitFor
ce) native; | 5884 Touch _$dom_createTouch_1(Window window, target, identifier, pageX, pageY, scr
eenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce) n
ative; |
| 5886 | 5885 |
| 5887 /// Use the [TouchList] constructor isntead. | 5886 /// Use the [TouchList] constructor isntead. |
| 5888 /// @domName Document.createTouchList; @docsEditable true | 5887 /// @domName Document.createTouchList; @docsEditable true |
| 5889 @JSName('createTouchList') | 5888 @JSName('createTouchList') |
| 5890 TouchList $dom_createTouchList() native; | 5889 TouchList $dom_createTouchList() native; |
| 5891 | 5890 |
| 5892 /// Moved to [HtmlDocument]. | 5891 /// Moved to [HtmlDocument]. |
| 5893 /// @domName Document.elementFromPoint; @docsEditable true | 5892 /// @domName Document.elementFromPoint; @docsEditable true |
| 5894 @JSName('elementFromPoint') | 5893 @JSName('elementFromPoint') |
| 5895 Element $dom_elementFromPoint(int x, int y) native; | 5894 Element $dom_elementFromPoint(int x, int y) native; |
| (...skipping 3613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9509 } | 9508 } |
| 9510 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 9509 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9511 // for details. All rights reserved. Use of this source code is governed by a | 9510 // for details. All rights reserved. Use of this source code is governed by a |
| 9512 // BSD-style license that can be found in the LICENSE file. | 9511 // BSD-style license that can be found in the LICENSE file. |
| 9513 | 9512 |
| 9514 | 9513 |
| 9515 /// @domName HTMLFrameElement; @docsEditable true | 9514 /// @domName HTMLFrameElement; @docsEditable true |
| 9516 class FrameElement extends Element native "*HTMLFrameElement" { | 9515 class FrameElement extends Element native "*HTMLFrameElement" { |
| 9517 | 9516 |
| 9518 /// @domName HTMLFrameElement.contentWindow; @docsEditable true | 9517 /// @domName HTMLFrameElement.contentWindow; @docsEditable true |
| 9519 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow); | 9518 WindowBase get contentWindow => _convertNativeToDart_Window(this._contentWindo
w); |
| 9520 @JSName('contentWindow') | 9519 @JSName('contentWindow') |
| 9521 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 9520 @Creates('Window|=Object') @Returns('Window|=Object') |
| 9522 final dynamic _contentWindow; | 9521 final dynamic _contentWindow; |
| 9523 | 9522 |
| 9524 /// @domName HTMLFrameElement.frameBorder; @docsEditable true | 9523 /// @domName HTMLFrameElement.frameBorder; @docsEditable true |
| 9525 String frameBorder; | 9524 String frameBorder; |
| 9526 | 9525 |
| 9527 /// @domName HTMLFrameElement.height; @docsEditable true | 9526 /// @domName HTMLFrameElement.height; @docsEditable true |
| 9528 final int height; | 9527 final int height; |
| 9529 | 9528 |
| 9530 /// @domName HTMLFrameElement.location; @docsEditable true | 9529 /// @domName HTMLFrameElement.location; @docsEditable true |
| 9531 String location; | 9530 String location; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9754 factory HeadingElement.h6() => document.$dom_createElement("h6"); | 9753 factory HeadingElement.h6() => document.$dom_createElement("h6"); |
| 9755 | 9754 |
| 9756 /// @domName HTMLHeadingElement.align; @docsEditable true | 9755 /// @domName HTMLHeadingElement.align; @docsEditable true |
| 9757 String align; | 9756 String align; |
| 9758 } | 9757 } |
| 9759 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 9758 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9760 // for details. All rights reserved. Use of this source code is governed by a | 9759 // for details. All rights reserved. Use of this source code is governed by a |
| 9761 // BSD-style license that can be found in the LICENSE file. | 9760 // BSD-style license that can be found in the LICENSE file. |
| 9762 | 9761 |
| 9763 | 9762 |
| 9763 /// @domName History; @docsEditable true |
| 9764 class History implements HistoryBase native "*History" { |
| 9765 |
| 9766 /// @domName History.length; @docsEditable true |
| 9767 final int length; |
| 9768 |
| 9769 /// @domName History.state; @docsEditable true |
| 9770 dynamic get state => _convertNativeToDart_SerializedScriptValue(this._state); |
| 9771 @JSName('state') |
| 9772 @annotation_Creates_SerializedScriptValue @annotation_Returns_SerializedScript
Value |
| 9773 final dynamic _state; |
| 9774 |
| 9775 /// @domName History.back; @docsEditable true |
| 9776 void back() native; |
| 9777 |
| 9778 /// @domName History.forward; @docsEditable true |
| 9779 void forward() native; |
| 9780 |
| 9781 /// @domName History.go; @docsEditable true |
| 9782 void go(int distance) native; |
| 9783 |
| 9784 /// @domName History.pushState; @docsEditable true |
| 9785 void pushState(Object data, String title, [String url]) native; |
| 9786 |
| 9787 /// @domName History.replaceState; @docsEditable true |
| 9788 void replaceState(Object data, String title, [String url]) native; |
| 9789 } |
| 9790 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9791 // for details. All rights reserved. Use of this source code is governed by a |
| 9792 // BSD-style license that can be found in the LICENSE file. |
| 9793 |
| 9794 |
| 9764 /// @domName HTMLAllCollection; @docsEditable true | 9795 /// @domName HTMLAllCollection; @docsEditable true |
| 9765 class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native
"*HTMLAllCollection" { | 9796 class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native
"*HTMLAllCollection" { |
| 9766 | 9797 |
| 9767 /// @domName HTMLAllCollection.length; @docsEditable true | 9798 /// @domName HTMLAllCollection.length; @docsEditable true |
| 9768 int get length => JS("int", "#.length", this); | 9799 int get length => JS("int", "#.length", this); |
| 9769 | 9800 |
| 9770 Node operator[](int index) => JS("Node", "#[#]", this, index); | 9801 Node operator[](int index) => JS("Node", "#[#]", this, index); |
| 9771 | 9802 |
| 9772 void operator[]=(int index, Node value) { | 9803 void operator[]=(int index, Node value) { |
| 9773 throw new UnsupportedError("Cannot assign element of immutable List."); | 9804 throw new UnsupportedError("Cannot assign element of immutable List."); |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10574 /// @domName HTMLIFrameElement; @docsEditable true | 10605 /// @domName HTMLIFrameElement; @docsEditable true |
| 10575 class IFrameElement extends Element native "*HTMLIFrameElement" { | 10606 class IFrameElement extends Element native "*HTMLIFrameElement" { |
| 10576 | 10607 |
| 10577 ///@docsEditable true | 10608 ///@docsEditable true |
| 10578 factory IFrameElement() => document.$dom_createElement("iframe"); | 10609 factory IFrameElement() => document.$dom_createElement("iframe"); |
| 10579 | 10610 |
| 10580 /// @domName HTMLIFrameElement.align; @docsEditable true | 10611 /// @domName HTMLIFrameElement.align; @docsEditable true |
| 10581 String align; | 10612 String align; |
| 10582 | 10613 |
| 10583 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true | 10614 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true |
| 10584 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow); | 10615 WindowBase get contentWindow => _convertNativeToDart_Window(this._contentWindo
w); |
| 10585 @JSName('contentWindow') | 10616 @JSName('contentWindow') |
| 10586 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 10617 @Creates('Window|=Object') @Returns('Window|=Object') |
| 10587 final dynamic _contentWindow; | 10618 final dynamic _contentWindow; |
| 10588 | 10619 |
| 10589 /// @domName HTMLIFrameElement.frameBorder; @docsEditable true | 10620 /// @domName HTMLIFrameElement.frameBorder; @docsEditable true |
| 10590 String frameBorder; | 10621 String frameBorder; |
| 10591 | 10622 |
| 10592 /// @domName HTMLIFrameElement.height; @docsEditable true | 10623 /// @domName HTMLIFrameElement.height; @docsEditable true |
| 10593 String height; | 10624 String height; |
| 10594 | 10625 |
| 10595 /// @domName HTMLIFrameElement.longDesc; @docsEditable true | 10626 /// @domName HTMLIFrameElement.longDesc; @docsEditable true |
| 10596 String longDesc; | 10627 String longDesc; |
| (...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11857 } | 11888 } |
| 11858 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 11889 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 11859 // for details. All rights reserved. Use of this source code is governed by a | 11890 // for details. All rights reserved. Use of this source code is governed by a |
| 11860 // BSD-style license that can be found in the LICENSE file. | 11891 // BSD-style license that can be found in the LICENSE file. |
| 11861 | 11892 |
| 11862 | 11893 |
| 11863 /// @domName KeyboardEvent; @docsEditable true | 11894 /// @domName KeyboardEvent; @docsEditable true |
| 11864 class KeyboardEvent extends UIEvent native "*KeyboardEvent" { | 11895 class KeyboardEvent extends UIEvent native "*KeyboardEvent" { |
| 11865 | 11896 |
| 11866 factory KeyboardEvent(String type, Window view, | 11897 factory KeyboardEvent(String type, Window view, |
| 11867 [bool canBubble = true, bool cancelable = true, | 11898 [bool canBubble = true, bool cancelable = true, |
| 11868 String keyIdentifier = "", int keyLocation = 1, bool ctrlKey = false, | 11899 String keyIdentifier = "", int keyLocation = 1, bool ctrlKey = false, |
| 11869 bool altKey = false, bool shiftKey = false, bool metaKey = false, | 11900 bool altKey = false, bool shiftKey = false, bool metaKey = false, |
| 11870 bool altGraphKey = false]) { | 11901 bool altGraphKey = false]) { |
| 11871 final e = document.$dom_createEvent("KeyboardEvent"); | 11902 final e = document.$dom_createEvent("KeyboardEvent"); |
| 11872 e.$dom_initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, | 11903 e.$dom_initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, |
| 11873 keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey); | 11904 keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey); |
| 11874 return e; | 11905 return e; |
| 11875 } | 11906 } |
| 11876 | 11907 |
| 11877 /** @domName KeyboardEvent.initKeyboardEvent */ | 11908 /** @domName KeyboardEvent.initKeyboardEvent */ |
| 11878 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, | 11909 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| 11879 LocalWindow view, String keyIdentifier, int keyLocation, bool ctrlKey, | 11910 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| 11880 bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) { | 11911 bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) { |
| 11881 if (JS('bool', 'typeof(#.initKeyEvent) == "function"', this)) { | 11912 if (JS('bool', 'typeof(#.initKeyEvent) == "function"', this)) { |
| 11882 // initKeyEvent is only in Firefox (instead of initKeyboardEvent). It has | 11913 // initKeyEvent is only in Firefox (instead of initKeyboardEvent). It has |
| 11883 // a slightly different signature, and allows you to specify keyCode and | 11914 // a slightly different signature, and allows you to specify keyCode and |
| 11884 // charCode as the last two arguments, but we just set them as the default | 11915 // charCode as the last two arguments, but we just set them as the default |
| 11885 // since they can't be specified in other browsers. | 11916 // since they can't be specified in other browsers. |
| 11886 JS('void', '#.initKeyEvent(#, #, #, #, #, #, #, #, 0, 0)', this, | 11917 JS('void', '#.initKeyEvent(#, #, #, #, #, #, #, #, 0, 0)', this, |
| 11887 type, canBubble, cancelable, view, | 11918 type, canBubble, cancelable, view, |
| 11888 ctrlKey, altKey, shiftKey, metaKey); | 11919 ctrlKey, altKey, shiftKey, metaKey); |
| 11889 } else { | 11920 } else { |
| 11890 // initKeyboardEvent is for all other browsers. | 11921 // initKeyboardEvent is for all other browsers. |
| 11891 JS('void', '#.initKeyboardEvent(#, #, #, #, #, #, #, #, #, #, #)', this, | 11922 JS('void', '#.initKeyboardEvent(#, #, #, #, #, #, #, #, #, #, #)', this, |
| 11892 type, canBubble, cancelable, view, keyIdentifier, keyLocation, | 11923 type, canBubble, cancelable, view, keyIdentifier, keyLocation, |
| 11893 ctrlKey, altKey, shiftKey, metaKey, altGraphKey); | 11924 ctrlKey, altKey, shiftKey, metaKey, altGraphKey); |
| 11894 } | 11925 } |
| 11895 } | 11926 } |
| 11896 | 11927 |
| 11897 /** @domName KeyboardEvent.keyCode */ | 11928 /** @domName KeyboardEvent.keyCode */ |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12070 String target; | 12101 String target; |
| 12071 | 12102 |
| 12072 /// @domName HTMLLinkElement.type; @docsEditable true | 12103 /// @domName HTMLLinkElement.type; @docsEditable true |
| 12073 String type; | 12104 String type; |
| 12074 } | 12105 } |
| 12075 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 12106 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12076 // for details. All rights reserved. Use of this source code is governed by a | 12107 // for details. All rights reserved. Use of this source code is governed by a |
| 12077 // BSD-style license that can be found in the LICENSE file. | 12108 // BSD-style license that can be found in the LICENSE file. |
| 12078 | 12109 |
| 12079 | 12110 |
| 12080 /// @domName History; @docsEditable true | 12111 /// @domName LocalMediaStream; @docsEditable true |
| 12081 class LocalHistory implements History native "*History" { | 12112 class LocalMediaStream extends MediaStream implements EventTarget native "*Local
MediaStream" { |
| 12082 | 12113 |
| 12083 /// @domName History.length; @docsEditable true | 12114 /// @domName LocalMediaStream.stop; @docsEditable true |
| 12084 final int length; | 12115 void stop() native; |
| 12085 | |
| 12086 /// @domName History.state; @docsEditable true | |
| 12087 dynamic get state => _convertNativeToDart_SerializedScriptValue(this._state); | |
| 12088 @JSName('state') | |
| 12089 @annotation_Creates_SerializedScriptValue @annotation_Returns_SerializedScript
Value | |
| 12090 final dynamic _state; | |
| 12091 | |
| 12092 /// @domName History.back; @docsEditable true | |
| 12093 void back() native; | |
| 12094 | |
| 12095 /// @domName History.forward; @docsEditable true | |
| 12096 void forward() native; | |
| 12097 | |
| 12098 /// @domName History.go; @docsEditable true | |
| 12099 void go(int distance) native; | |
| 12100 | |
| 12101 /// @domName History.pushState; @docsEditable true | |
| 12102 void pushState(Object data, String title, [String url]) native; | |
| 12103 | |
| 12104 /// @domName History.replaceState; @docsEditable true | |
| 12105 void replaceState(Object data, String title, [String url]) native; | |
| 12106 } | 12116 } |
| 12107 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 12117 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12108 // for details. All rights reserved. Use of this source code is governed by a | 12118 // for details. All rights reserved. Use of this source code is governed by a |
| 12109 // BSD-style license that can be found in the LICENSE file. | 12119 // BSD-style license that can be found in the LICENSE file. |
| 12110 | 12120 |
| 12111 | 12121 |
| 12112 /// @domName Location; @docsEditable true | 12122 /// @domName Location; @docsEditable true |
| 12113 class LocalLocation implements Location native "*Location" { | 12123 class Location implements LocationBase native "*Location" { |
| 12114 | 12124 |
| 12115 /// @domName Location.ancestorOrigins; @docsEditable true | 12125 /// @domName Location.ancestorOrigins; @docsEditable true |
| 12116 @Returns('DomStringList') @Creates('DomStringList') | 12126 @Returns('DomStringList') @Creates('DomStringList') |
| 12117 final List<String> ancestorOrigins; | 12127 final List<String> ancestorOrigins; |
| 12118 | 12128 |
| 12119 /// @domName Location.hash; @docsEditable true | 12129 /// @domName Location.hash; @docsEditable true |
| 12120 String hash; | 12130 String hash; |
| 12121 | 12131 |
| 12122 /// @domName Location.host; @docsEditable true | 12132 /// @domName Location.host; @docsEditable true |
| 12123 String host; | 12133 String host; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 12153 void replace(String url) native; | 12163 void replace(String url) native; |
| 12154 | 12164 |
| 12155 /// @domName Location.toString; @docsEditable true | 12165 /// @domName Location.toString; @docsEditable true |
| 12156 String toString() native; | 12166 String toString() native; |
| 12157 } | 12167 } |
| 12158 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 12168 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12159 // for details. All rights reserved. Use of this source code is governed by a | 12169 // for details. All rights reserved. Use of this source code is governed by a |
| 12160 // BSD-style license that can be found in the LICENSE file. | 12170 // BSD-style license that can be found in the LICENSE file. |
| 12161 | 12171 |
| 12162 | 12172 |
| 12163 /// @domName LocalMediaStream; @docsEditable true | 12173 /// @domName HTMLMapElement; @docsEditable true |
| 12164 class LocalMediaStream extends MediaStream implements EventTarget native "*Local
MediaStream" { | 12174 class MapElement extends Element native "*HTMLMapElement" { |
| 12165 | 12175 |
| 12166 /// @domName LocalMediaStream.stop; @docsEditable true | 12176 ///@docsEditable true |
| 12167 void stop() native; | 12177 factory MapElement() => document.$dom_createElement("map"); |
| 12178 |
| 12179 /// @domName HTMLMapElement.areas; @docsEditable true |
| 12180 final HtmlCollection areas; |
| 12181 |
| 12182 /// @domName HTMLMapElement.name; @docsEditable true |
| 12183 String name; |
| 12168 } | 12184 } |
| 12169 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 12185 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12170 // for details. All rights reserved. Use of this source code is governed by a | 12186 // for details. All rights reserved. Use of this source code is governed by a |
| 12171 // BSD-style license that can be found in the LICENSE file. | 12187 // BSD-style license that can be found in the LICENSE file. |
| 12172 | 12188 |
| 12173 | 12189 |
| 12174 /// @domName Window | 12190 /// @domName HTMLMarqueeElement; @docsEditable true |
| 12175 class LocalWindow extends EventTarget implements Window native "@*DOMWindow" { | 12191 class MarqueeElement extends Element native "*HTMLMarqueeElement" { |
| 12176 | 12192 |
| 12177 Document get document => JS('Document', '#.document', this); | 12193 /// @domName HTMLMarqueeElement.behavior; @docsEditable true |
| 12178 | 12194 String behavior; |
| 12179 Window _open2(url, name) => JS('Window', '#.open(#,#)', this, url, name); | 12195 |
| 12180 | 12196 /// @domName HTMLMarqueeElement.bgColor; @docsEditable true |
| 12181 Window _open3(url, name, options) => | 12197 String bgColor; |
| 12182 JS('Window', '#.open(#,#,#)', this, url, name, options); | 12198 |
| 12183 | 12199 /// @domName HTMLMarqueeElement.direction; @docsEditable true |
| 12184 Window open(String url, String name, [String options]) { | 12200 String direction; |
| 12185 if (options == null) { | 12201 |
| 12186 return _DOMWindowCrossFrame._createSafe(_open2(url, name)); | 12202 /// @domName HTMLMarqueeElement.height; @docsEditable true |
| 12187 } else { | 12203 String height; |
| 12188 return _DOMWindowCrossFrame._createSafe(_open3(url, name, options)); | 12204 |
| 12189 } | 12205 /// @domName HTMLMarqueeElement.hspace; @docsEditable true |
| 12190 } | 12206 int hspace; |
| 12191 | 12207 |
| 12192 // API level getter and setter for Location. | 12208 /// @domName HTMLMarqueeElement.loop; @docsEditable true |
| 12193 // TODO: The cross domain safe wrapper can be inserted here or folded into | 12209 int loop; |
| 12194 // _LocationWrapper. | 12210 |
| 12195 LocalLocation get location { | 12211 /// @domName HTMLMarqueeElement.scrollAmount; @docsEditable true |
| 12196 // Firefox work-around for Location. The Firefox location object cannot be | 12212 int scrollAmount; |
| 12197 // made to behave like a Dart object so must be wrapped. | 12213 |
| 12198 var result = _location; | 12214 /// @domName HTMLMarqueeElement.scrollDelay; @docsEditable true |
| 12199 if (_isDartLocation(result)) return result; // e.g. on Chrome. | 12215 int scrollDelay; |
| 12200 if (null == _location_wrapper) { | 12216 |
| 12201 _location_wrapper = new _LocationWrapper(result); | 12217 /// @domName HTMLMarqueeElement.trueSpeed; @docsEditable true |
| 12202 } | 12218 bool trueSpeed; |
| 12203 return _location_wrapper; | 12219 |
| 12204 } | 12220 /// @domName HTMLMarqueeElement.vspace; @docsEditable true |
| 12205 | 12221 int vspace; |
| 12206 // TODO: consider forcing users to do: window.location.assign('string'). | 12222 |
| 12207 /** | 12223 /// @domName HTMLMarqueeElement.width; @docsEditable true |
| 12208 * Sets the window's location, which causes the browser to navigate to the new | 12224 String width; |
| 12209 * location. [value] may be a Location object or a string. | 12225 |
| 12210 */ | 12226 /// @domName HTMLMarqueeElement.start; @docsEditable true |
| 12211 void set location(value) { | 12227 void start() native; |
| 12212 if (value is _LocationWrapper) { | 12228 |
| 12213 _location = value._ptr; | 12229 /// @domName HTMLMarqueeElement.stop; @docsEditable true |
| 12214 } else { | 12230 void stop() native; |
| 12215 _location = value; | 12231 } |
| 12216 } | 12232 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12217 } | 12233 // for details. All rights reserved. Use of this source code is governed by a |
| 12218 | 12234 // BSD-style license that can be found in the LICENSE file. |
| 12219 _LocationWrapper _location_wrapper; // Cached wrapped Location object. | 12235 |
| 12220 | 12236 |
| 12221 // Native getter and setter to access raw Location object. | 12237 /// @domName MediaController; @docsEditable true |
| 12222 dynamic get _location => JS('Location|=Object', '#.location', this); | 12238 class MediaController extends EventTarget native "*MediaController" { |
| 12223 void set _location(value) { | 12239 |
| 12224 JS('void', '#.location = #', this, value); | 12240 ///@docsEditable true |
| 12225 } | 12241 factory MediaController() => _MediaControllerFactoryProvider.createMediaContro
ller(); |
| 12226 // Prevent compiled from thinking 'location' property is available for a Dart | 12242 |
| 12227 // member. | 12243 /// @domName MediaController.buffered; @docsEditable true |
| 12228 @JSName('location') | 12244 final TimeRanges buffered; |
| 12229 _protect_location() native; | 12245 |
| 12230 | 12246 /// @domName MediaController.currentTime; @docsEditable true |
| 12231 static _isDartLocation(thing) { | 12247 num currentTime; |
| 12232 // On Firefox the code that implements 'is Location' fails to find the patch | 12248 |
| 12233 // stub on Object.prototype and throws an exception. | 12249 /// @domName MediaController.defaultPlaybackRate; @docsEditable true |
| 12234 try { | 12250 num defaultPlaybackRate; |
| 12235 return thing is Location; | 12251 |
| 12236 } catch (e) { | 12252 /// @domName MediaController.duration; @docsEditable true |
| 12237 return false; | 12253 final num duration; |
| 12238 } | 12254 |
| 12239 } | 12255 /// @domName MediaController.muted; @docsEditable true |
| 12240 | 12256 bool muted; |
| 12241 /** | 12257 |
| 12242 * Executes a [callback] after the next batch of browser layout measurements | 12258 /// @domName MediaController.paused; @docsEditable true |
| 12243 * has completed or would have completed if any browser layout measurements | 12259 final bool paused; |
| 12244 * had been scheduled. | 12260 |
| 12245 */ | 12261 /// @domName MediaController.playbackRate; @docsEditable true |
| 12246 void requestLayoutFrame(TimeoutHandler callback) { | 12262 num playbackRate; |
| 12247 _addMeasurementFrameCallback(callback); | 12263 |
| 12248 } | 12264 /// @domName MediaController.played; @docsEditable true |
| 12249 | 12265 final TimeRanges played; |
| 12250 /** @domName DOMWindow.requestAnimationFrame */ | 12266 |
| 12251 int requestAnimationFrame(RequestAnimationFrameCallback callback) { | 12267 /// @domName MediaController.seekable; @docsEditable true |
| 12252 _ensureRequestAnimationFrame(); | 12268 final TimeRanges seekable; |
| 12253 return _requestAnimationFrame(callback); | 12269 |
| 12254 } | 12270 /// @domName MediaController.volume; @docsEditable true |
| 12255 | 12271 num volume; |
| 12256 void cancelAnimationFrame(id) { | 12272 |
| 12257 _ensureRequestAnimationFrame(); | 12273 /// @domName MediaController.addEventListener; @docsEditable true |
| 12258 _cancelAnimationFrame(id); | |
| 12259 } | |
| 12260 | |
| 12261 @JSName('requestAnimationFrame') | |
| 12262 int _requestAnimationFrame(RequestAnimationFrameCallback callback) native; | |
| 12263 | |
| 12264 @JSName('cancelAnimationFrame') | |
| 12265 void _cancelAnimationFrame(int id) native; | |
| 12266 | |
| 12267 _ensureRequestAnimationFrame() { | |
| 12268 if (JS('bool', | |
| 12269 '!!(#.requestAnimationFrame && #.cancelAnimationFrame)', this, this)) | |
| 12270 return; | |
| 12271 | |
| 12272 JS('void', | |
| 12273 r""" | |
| 12274 (function($this) { | |
| 12275 var vendors = ['ms', 'moz', 'webkit', 'o']; | |
| 12276 for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) { | |
| 12277 $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame']; | |
| 12278 $this.cancelAnimationFrame = | |
| 12279 $this[vendors[i]+'CancelAnimationFrame'] || | |
| 12280 $this[vendors[i]+'CancelRequestAnimationFrame']; | |
| 12281 } | |
| 12282 if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return; | |
| 12283 $this.requestAnimationFrame = function(callback) { | |
| 12284 return window.setTimeout(function() { | |
| 12285 callback(Date.now()); | |
| 12286 }, 16 /* 16ms ~= 60fps */); | |
| 12287 }; | |
| 12288 $this.cancelAnimationFrame = function(id) { clearTimeout(id); } | |
| 12289 })(#)""", | |
| 12290 this); | |
| 12291 } | |
| 12292 | |
| 12293 IdbFactory get indexedDB => | |
| 12294 JS('IdbFactory', | |
| 12295 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', | |
| 12296 this, this, this); | |
| 12297 | |
| 12298 /** | |
| 12299 * Lookup a port by its [name]. Return null if no port is | |
| 12300 * registered under [name]. | |
| 12301 */ | |
| 12302 SendPortSync lookupPort(String name) { | |
| 12303 var port = JSON.parse(document.documentElement.attributes['dart-port:$name']
); | |
| 12304 return _deserialize(port); | |
| 12305 } | |
| 12306 | |
| 12307 /** | |
| 12308 * Register a [port] on this window under the given [name]. This | |
| 12309 * port may be retrieved by any isolate (or JavaScript script) | |
| 12310 * running in this window. | |
| 12311 */ | |
| 12312 void registerPort(String name, var port) { | |
| 12313 var serialized = _serialize(port); | |
| 12314 document.documentElement.attributes['dart-port:$name'] = JSON.stringify(seri
alized); | |
| 12315 } | |
| 12316 | |
| 12317 /// @domName Window.console; @docsEditable true | |
| 12318 Console get console => Console.safeConsole; | |
| 12319 | |
| 12320 | |
| 12321 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 12322 LocalWindowEvents get on => | |
| 12323 new LocalWindowEvents(this); | |
| 12324 | |
| 12325 static const int PERSISTENT = 1; | |
| 12326 | |
| 12327 static const int TEMPORARY = 0; | |
| 12328 | |
| 12329 /// @domName Window.applicationCache; @docsEditable true | |
| 12330 final ApplicationCache applicationCache; | |
| 12331 | |
| 12332 /// @domName Window.closed; @docsEditable true | |
| 12333 final bool closed; | |
| 12334 | |
| 12335 /// @domName Window.crypto; @docsEditable true | |
| 12336 final Crypto crypto; | |
| 12337 | |
| 12338 /// @domName Window.defaultStatus; @docsEditable true | |
| 12339 String defaultStatus; | |
| 12340 | |
| 12341 /// @domName Window.defaultstatus; @docsEditable true | |
| 12342 String defaultstatus; | |
| 12343 | |
| 12344 /// @domName Window.devicePixelRatio; @docsEditable true | |
| 12345 final num devicePixelRatio; | |
| 12346 | |
| 12347 /// @domName Window.event; @docsEditable true | |
| 12348 final Event event; | |
| 12349 | |
| 12350 /// @domName Window.history; @docsEditable true | |
| 12351 final LocalHistory history; | |
| 12352 | |
| 12353 /// @domName Window.innerHeight; @docsEditable true | |
| 12354 final int innerHeight; | |
| 12355 | |
| 12356 /// @domName Window.innerWidth; @docsEditable true | |
| 12357 final int innerWidth; | |
| 12358 | |
| 12359 /// @domName Window.localStorage; @docsEditable true | |
| 12360 final Storage localStorage; | |
| 12361 | |
| 12362 /// @domName Window.locationbar; @docsEditable true | |
| 12363 final BarInfo locationbar; | |
| 12364 | |
| 12365 /// @domName Window.menubar; @docsEditable true | |
| 12366 final BarInfo menubar; | |
| 12367 | |
| 12368 /// @domName Window.name; @docsEditable true | |
| 12369 String name; | |
| 12370 | |
| 12371 /// @domName Window.navigator; @docsEditable true | |
| 12372 final Navigator navigator; | |
| 12373 | |
| 12374 /// @domName Window.offscreenBuffering; @docsEditable true | |
| 12375 final bool offscreenBuffering; | |
| 12376 | |
| 12377 /// @domName Window.opener; @docsEditable true | |
| 12378 Window get opener => _convertNativeToDart_Window(this._opener); | |
| 12379 @JSName('opener') | |
| 12380 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | |
| 12381 final dynamic _opener; | |
| 12382 | |
| 12383 /// @domName Window.outerHeight; @docsEditable true | |
| 12384 final int outerHeight; | |
| 12385 | |
| 12386 /// @domName Window.outerWidth; @docsEditable true | |
| 12387 final int outerWidth; | |
| 12388 | |
| 12389 /// @domName DOMWindow.pagePopupController; @docsEditable true | |
| 12390 final PagePopupController pagePopupController; | |
| 12391 | |
| 12392 /// @domName Window.pageXOffset; @docsEditable true | |
| 12393 final int pageXOffset; | |
| 12394 | |
| 12395 /// @domName Window.pageYOffset; @docsEditable true | |
| 12396 final int pageYOffset; | |
| 12397 | |
| 12398 /// @domName Window.parent; @docsEditable true | |
| 12399 Window get parent => _convertNativeToDart_Window(this._parent); | |
| 12400 @JSName('parent') | |
| 12401 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | |
| 12402 final dynamic _parent; | |
| 12403 | |
| 12404 /// @domName Window.performance; @docsEditable true | |
| 12405 final Performance performance; | |
| 12406 | |
| 12407 /// @domName Window.personalbar; @docsEditable true | |
| 12408 final BarInfo personalbar; | |
| 12409 | |
| 12410 /// @domName Window.screen; @docsEditable true | |
| 12411 final Screen screen; | |
| 12412 | |
| 12413 /// @domName Window.screenLeft; @docsEditable true | |
| 12414 final int screenLeft; | |
| 12415 | |
| 12416 /// @domName Window.screenTop; @docsEditable true | |
| 12417 final int screenTop; | |
| 12418 | |
| 12419 /// @domName Window.screenX; @docsEditable true | |
| 12420 final int screenX; | |
| 12421 | |
| 12422 /// @domName Window.screenY; @docsEditable true | |
| 12423 final int screenY; | |
| 12424 | |
| 12425 /// @domName Window.scrollX; @docsEditable true | |
| 12426 final int scrollX; | |
| 12427 | |
| 12428 /// @domName Window.scrollY; @docsEditable true | |
| 12429 final int scrollY; | |
| 12430 | |
| 12431 /// @domName Window.scrollbars; @docsEditable true | |
| 12432 final BarInfo scrollbars; | |
| 12433 | |
| 12434 /// @domName Window.self; @docsEditable true | |
| 12435 Window get self => _convertNativeToDart_Window(this._self); | |
| 12436 @JSName('self') | |
| 12437 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | |
| 12438 final dynamic _self; | |
| 12439 | |
| 12440 /// @domName Window.sessionStorage; @docsEditable true | |
| 12441 final Storage sessionStorage; | |
| 12442 | |
| 12443 /// @domName Window.status; @docsEditable true | |
| 12444 String status; | |
| 12445 | |
| 12446 /// @domName Window.statusbar; @docsEditable true | |
| 12447 final BarInfo statusbar; | |
| 12448 | |
| 12449 /// @domName Window.styleMedia; @docsEditable true | |
| 12450 final StyleMedia styleMedia; | |
| 12451 | |
| 12452 /// @domName Window.toolbar; @docsEditable true | |
| 12453 final BarInfo toolbar; | |
| 12454 | |
| 12455 /// @domName Window.top; @docsEditable true | |
| 12456 Window get top => _convertNativeToDart_Window(this._top); | |
| 12457 @JSName('top') | |
| 12458 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | |
| 12459 final dynamic _top; | |
| 12460 | |
| 12461 /// @domName DOMWindow.webkitNotifications; @docsEditable true | |
| 12462 final NotificationCenter webkitNotifications; | |
| 12463 | |
| 12464 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true | |
| 12465 final StorageInfo webkitStorageInfo; | |
| 12466 | |
| 12467 /// @domName Window.window; @docsEditable true | |
| 12468 Window get window => _convertNativeToDart_Window(this._window); | |
| 12469 @JSName('window') | |
| 12470 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | |
| 12471 final dynamic _window; | |
| 12472 | |
| 12473 /// @domName Window.addEventListener; @docsEditable true | |
| 12474 @JSName('addEventListener') | 12274 @JSName('addEventListener') |
| 12475 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 12275 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 12476 | 12276 |
| 12477 /// @domName Window.alert; @docsEditable true | 12277 /// @domName MediaController.dispatchEvent; @docsEditable true |
| 12478 void alert(String message) native; | |
| 12479 | |
| 12480 /// @domName Window.atob; @docsEditable true | |
| 12481 String atob(String string) native; | |
| 12482 | |
| 12483 /// @domName Window.btoa; @docsEditable true | |
| 12484 String btoa(String string) native; | |
| 12485 | |
| 12486 /// @domName Window.captureEvents; @docsEditable true | |
| 12487 void captureEvents() native; | |
| 12488 | |
| 12489 /// @domName Window.clearInterval; @docsEditable true | |
| 12490 void clearInterval(int handle) native; | |
| 12491 | |
| 12492 /// @domName Window.clearTimeout; @docsEditable true | |
| 12493 void clearTimeout(int handle) native; | |
| 12494 | |
| 12495 /// @domName Window.close; @docsEditable true | |
| 12496 void close() native; | |
| 12497 | |
| 12498 /// @domName Window.confirm; @docsEditable true | |
| 12499 bool confirm(String message) native; | |
| 12500 | |
| 12501 /// @domName Window.dispatchEvent; @docsEditable true | |
| 12502 @JSName('dispatchEvent') | 12278 @JSName('dispatchEvent') |
| 12503 bool $dom_dispatchEvent(Event evt) native; | 12279 bool $dom_dispatchEvent(Event evt) native; |
| 12504 | 12280 |
| 12505 /// @domName Window.find; @docsEditable true | 12281 /// @domName MediaController.pause; @docsEditable true |
| 12506 bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool w
holeWord, bool searchInFrames, bool showDialog) native; | 12282 void pause() native; |
| 12507 | 12283 |
| 12508 /// @domName Window.getComputedStyle; @docsEditable true | 12284 /// @domName MediaController.play; @docsEditable true |
| 12509 @JSName('getComputedStyle') | 12285 void play() native; |
| 12510 CssStyleDeclaration $dom_getComputedStyle(Element element, String pseudoElemen
t) native; | 12286 |
| 12511 | 12287 /// @domName MediaController.removeEventListener; @docsEditable true |
| 12512 /// @domName Window.getMatchedCSSRules; @docsEditable true | |
| 12513 @JSName('getMatchedCSSRules') | |
| 12514 @Returns('_CssRuleList') @Creates('_CssRuleList') | |
| 12515 List<CssRule> getMatchedCssRules(Element element, String pseudoElement) native
; | |
| 12516 | |
| 12517 /// @domName Window.getSelection; @docsEditable true | |
| 12518 DomSelection getSelection() native; | |
| 12519 | |
| 12520 /// @domName Window.matchMedia; @docsEditable true | |
| 12521 MediaQueryList matchMedia(String query) native; | |
| 12522 | |
| 12523 /// @domName Window.moveBy; @docsEditable true | |
| 12524 void moveBy(num x, num y) native; | |
| 12525 | |
| 12526 /// @domName Window.moveTo; @docsEditable true | |
| 12527 void moveTo(num x, num y) native; | |
| 12528 | |
| 12529 /// @domName DOMWindow.openDatabase; @docsEditable true | |
| 12530 @Creates('Database') @Creates('DatabaseSync') | |
| 12531 Database openDatabase(String name, String version, String displayName, int est
imatedSize, [DatabaseCallback creationCallback]) native; | |
| 12532 | |
| 12533 /// @domName Window.postMessage; @docsEditable true | |
| 12534 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List
messagePorts]) { | |
| 12535 if (?message && | |
| 12536 !?messagePorts) { | |
| 12537 var message_1 = convertDartToNative_SerializedScriptValue(message); | |
| 12538 _postMessage_1(message_1, targetOrigin); | |
| 12539 return; | |
| 12540 } | |
| 12541 if (?message) { | |
| 12542 var message_2 = convertDartToNative_SerializedScriptValue(message); | |
| 12543 _postMessage_2(message_2, targetOrigin, messagePorts); | |
| 12544 return; | |
| 12545 } | |
| 12546 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 12547 } | |
| 12548 @JSName('postMessage') | |
| 12549 void _postMessage_1(message, targetOrigin) native; | |
| 12550 @JSName('postMessage') | |
| 12551 void _postMessage_2(message, targetOrigin, List messagePorts) native; | |
| 12552 | |
| 12553 /// @domName Window.print; @docsEditable true | |
| 12554 void print() native; | |
| 12555 | |
| 12556 /// @domName Window.releaseEvents; @docsEditable true | |
| 12557 void releaseEvents() native; | |
| 12558 | |
| 12559 /// @domName Window.removeEventListener; @docsEditable true | |
| 12560 @JSName('removeEventListener') | 12288 @JSName('removeEventListener') |
| 12561 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 12289 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 12562 | 12290 } |
| 12563 /// @domName Window.resizeBy; @docsEditable true | 12291 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 12564 void resizeBy(num x, num y) native; | 12292 // for details. All rights reserved. Use of this source code is governed by a |
| 12565 | 12293 // BSD-style license that can be found in the LICENSE file. |
| 12566 /// @domName Window.resizeTo; @docsEditable true | 12294 |
| 12567 void resizeTo(num width, num height) native; | 12295 |
| 12568 | 12296 /// @domName HTMLMediaElement; @docsEditable true |
| 12569 /// @domName Window.scroll; @docsEditable true | 12297 class MediaElement extends Element native "*HTMLMediaElement" { |
| 12570 void scroll(int x, int y) native; | 12298 |
| 12571 | 12299 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 12572 /// @domName Window.scrollBy; @docsEditable true | 12300 MediaElementEvents get on => |
| 12573 void scrollBy(int x, int y) native; | 12301 new MediaElementEvents(this); |
| 12574 | 12302 |
| 12575 /// @domName Window.scrollTo; @docsEditable true | 12303 static const int HAVE_CURRENT_DATA = 2; |
| 12576 void scrollTo(int x, int y) native; | 12304 |
| 12577 | 12305 static const int HAVE_ENOUGH_DATA = 4; |
| 12578 /// @domName Window.setInterval; @docsEditable true | 12306 |
| 12579 int setInterval(TimeoutHandler handler, int timeout) native; | 12307 static const int HAVE_FUTURE_DATA = 3; |
| 12580 | 12308 |
| 12581 /// @domName Window.setTimeout; @docsEditable true | 12309 static const int HAVE_METADATA = 1; |
| 12582 int setTimeout(TimeoutHandler handler, int timeout) native; | 12310 |
| 12583 | 12311 static const int HAVE_NOTHING = 0; |
| 12584 /// @domName Window.showModalDialog; @docsEditable true | 12312 |
| 12585 Object showModalDialog(String url, [Object dialogArgs, String featureArgs]) na
tive; | 12313 static const int NETWORK_EMPTY = 0; |
| 12586 | 12314 |
| 12587 /// @domName Window.stop; @docsEditable true | 12315 static const int NETWORK_IDLE = 1; |
| 12588 void stop() native; | 12316 |
| 12589 | 12317 static const int NETWORK_LOADING = 2; |
| 12590 /// @domName Window.webkitConvertPointFromNodeToPage; @docsEditable true | 12318 |
| 12591 Point webkitConvertPointFromNodeToPage(Node node, Point p) native; | 12319 static const int NETWORK_NO_SOURCE = 3; |
| 12592 | 12320 |
| 12593 /// @domName Window.webkitConvertPointFromPageToNode; @docsEditable true | 12321 /// @domName HTMLMediaElement.autoplay; @docsEditable true |
| 12594 Point webkitConvertPointFromPageToNode(Node node, Point p) native; | 12322 bool autoplay; |
| 12595 | 12323 |
| 12596 /// @domName DOMWindow.webkitRequestFileSystem; @docsEditable true | 12324 /// @domName HTMLMediaElement.buffered; @docsEditable true |
| 12597 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal
lback, [ErrorCallback errorCallback]) native; | 12325 final TimeRanges buffered; |
| 12598 | 12326 |
| 12599 /// @domName DOMWindow.webkitResolveLocalFileSystemURL; @docsEditable true | 12327 /// @domName HTMLMediaElement.controller; @docsEditable true |
| 12600 @JSName('webkitResolveLocalFileSystemURL') | 12328 MediaController controller; |
| 12601 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback
, [ErrorCallback errorCallback]) native; | 12329 |
| 12602 | 12330 /// @domName HTMLMediaElement.controls; @docsEditable true |
| 12331 bool controls; |
| 12332 |
| 12333 /// @domName HTMLMediaElement.currentSrc; @docsEditable true |
| 12334 final String currentSrc; |
| 12335 |
| 12336 /// @domName HTMLMediaElement.currentTime; @docsEditable true |
| 12337 num currentTime; |
| 12338 |
| 12339 /// @domName HTMLMediaElement.defaultMuted; @docsEditable true |
| 12340 bool defaultMuted; |
| 12341 |
| 12342 /// @domName HTMLMediaElement.defaultPlaybackRate; @docsEditable true |
| 12343 num defaultPlaybackRate; |
| 12344 |
| 12345 /// @domName HTMLMediaElement.duration; @docsEditable true |
| 12346 final num duration; |
| 12347 |
| 12348 /// @domName HTMLMediaElement.ended; @docsEditable true |
| 12349 final bool ended; |
| 12350 |
| 12351 /// @domName HTMLMediaElement.error; @docsEditable true |
| 12352 final MediaError error; |
| 12353 |
| 12354 /// @domName HTMLMediaElement.initialTime; @docsEditable true |
| 12355 final num initialTime; |
| 12356 |
| 12357 /// @domName HTMLMediaElement.loop; @docsEditable true |
| 12358 bool loop; |
| 12359 |
| 12360 /// @domName HTMLMediaElement.mediaGroup; @docsEditable true |
| 12361 String mediaGroup; |
| 12362 |
| 12363 /// @domName HTMLMediaElement.muted; @docsEditable true |
| 12364 bool muted; |
| 12365 |
| 12366 /// @domName HTMLMediaElement.networkState; @docsEditable true |
| 12367 final int networkState; |
| 12368 |
| 12369 /// @domName HTMLMediaElement.paused; @docsEditable true |
| 12370 final bool paused; |
| 12371 |
| 12372 /// @domName HTMLMediaElement.playbackRate; @docsEditable true |
| 12373 num playbackRate; |
| 12374 |
| 12375 /// @domName HTMLMediaElement.played; @docsEditable true |
| 12376 final TimeRanges played; |
| 12377 |
| 12378 /// @domName HTMLMediaElement.preload; @docsEditable true |
| 12379 String preload; |
| 12380 |
| 12381 /// @domName HTMLMediaElement.readyState; @docsEditable true |
| 12382 final int readyState; |
| 12383 |
| 12384 /// @domName HTMLMediaElement.seekable; @docsEditable true |
| 12385 final TimeRanges seekable; |
| 12386 |
| 12387 /// @domName HTMLMediaElement.seeking; @docsEditable true |
| 12388 final bool seeking; |
| 12389 |
| 12390 /// @domName HTMLMediaElement.src; @docsEditable true |
| 12391 String src; |
| 12392 |
| 12393 /// @domName HTMLMediaElement.startTime; @docsEditable true |
| 12394 final num startTime; |
| 12395 |
| 12396 /// @domName HTMLMediaElement.textTracks; @docsEditable true |
| 12397 final TextTrackList textTracks; |
| 12398 |
| 12399 /// @domName HTMLMediaElement.volume; @docsEditable true |
| 12400 num volume; |
| 12401 |
| 12402 /// @domName HTMLMediaElement.webkitAudioDecodedByteCount; @docsEditable true |
| 12403 final int webkitAudioDecodedByteCount; |
| 12404 |
| 12405 /// @domName HTMLMediaElement.webkitClosedCaptionsVisible; @docsEditable true |
| 12406 bool webkitClosedCaptionsVisible; |
| 12407 |
| 12408 /// @domName HTMLMediaElement.webkitHasClosedCaptions; @docsEditable true |
| 12409 final bool webkitHasClosedCaptions; |
| 12410 |
| 12411 /// @domName HTMLMediaElement.webkitPreservesPitch; @docsEditable true |
| 12412 bool webkitPreservesPitch; |
| 12413 |
| 12414 /// @domName HTMLMediaElement.webkitVideoDecodedByteCount; @docsEditable true |
| 12415 final int webkitVideoDecodedByteCount; |
| 12416 |
| 12417 /// @domName HTMLMediaElement.addTextTrack; @docsEditable true |
| 12418 TextTrack addTextTrack(String kind, [String label, String language]) native; |
| 12419 |
| 12420 /// @domName HTMLMediaElement.canPlayType; @docsEditable true |
| 12421 String canPlayType(String type, String keySystem) native; |
| 12422 |
| 12423 /// @domName HTMLMediaElement.load; @docsEditable true |
| 12424 void load() native; |
| 12425 |
| 12426 /// @domName HTMLMediaElement.pause; @docsEditable true |
| 12427 void pause() native; |
| 12428 |
| 12429 /// @domName HTMLMediaElement.play; @docsEditable true |
| 12430 void play() native; |
| 12431 |
| 12432 /// @domName HTMLMediaElement.webkitAddKey; @docsEditable true |
| 12433 void webkitAddKey(String keySystem, Uint8Array key, [Uint8Array initData, Stri
ng sessionId]) native; |
| 12434 |
| 12435 /// @domName HTMLMediaElement.webkitCancelKeyRequest; @docsEditable true |
| 12436 void webkitCancelKeyRequest(String keySystem, String sessionId) native; |
| 12437 |
| 12438 /// @domName HTMLMediaElement.webkitGenerateKeyRequest; @docsEditable true |
| 12439 void webkitGenerateKeyRequest(String keySystem, [Uint8Array initData]) native; |
| 12603 } | 12440 } |
| 12604 | 12441 |
| 12605 /// @docsEditable true | 12442 /// @docsEditable true |
| 12606 class LocalWindowEvents extends Events { | 12443 class MediaElementEvents extends ElementEvents { |
| 12607 /// @docsEditable true | 12444 /// @docsEditable true |
| 12608 LocalWindowEvents(EventTarget _ptr) : super(_ptr); | 12445 MediaElementEvents(EventTarget _ptr) : super(_ptr); |
| 12609 | |
| 12610 /// @docsEditable true | |
| 12611 EventListenerList get abort => this['abort']; | |
| 12612 | |
| 12613 /// @docsEditable true | |
| 12614 EventListenerList get beforeUnload => this['beforeunload']; | |
| 12615 | |
| 12616 /// @docsEditable true | |
| 12617 EventListenerList get blur => this['blur']; | |
| 12618 | 12446 |
| 12619 /// @docsEditable true | 12447 /// @docsEditable true |
| 12620 EventListenerList get canPlay => this['canplay']; | 12448 EventListenerList get canPlay => this['canplay']; |
| 12621 | 12449 |
| 12622 /// @docsEditable true | 12450 /// @docsEditable true |
| 12623 EventListenerList get canPlayThrough => this['canplaythrough']; | 12451 EventListenerList get canPlayThrough => this['canplaythrough']; |
| 12624 | 12452 |
| 12625 /// @docsEditable true | 12453 /// @docsEditable true |
| 12626 EventListenerList get change => this['change']; | |
| 12627 | |
| 12628 /// @docsEditable true | |
| 12629 EventListenerList get click => this['click']; | |
| 12630 | |
| 12631 /// @docsEditable true | |
| 12632 EventListenerList get contextMenu => this['contextmenu']; | |
| 12633 | |
| 12634 /// @docsEditable true | |
| 12635 EventListenerList get doubleClick => this['dblclick']; | |
| 12636 | |
| 12637 /// @docsEditable true | |
| 12638 EventListenerList get deviceMotion => this['devicemotion']; | |
| 12639 | |
| 12640 /// @docsEditable true | |
| 12641 EventListenerList get deviceOrientation => this['deviceorientation']; | |
| 12642 | |
| 12643 /// @docsEditable true | |
| 12644 EventListenerList get drag => this['drag']; | |
| 12645 | |
| 12646 /// @docsEditable true | |
| 12647 EventListenerList get dragEnd => this['dragend']; | |
| 12648 | |
| 12649 /// @docsEditable true | |
| 12650 EventListenerList get dragEnter => this['dragenter']; | |
| 12651 | |
| 12652 /// @docsEditable true | |
| 12653 EventListenerList get dragLeave => this['dragleave']; | |
| 12654 | |
| 12655 /// @docsEditable true | |
| 12656 EventListenerList get dragOver => this['dragover']; | |
| 12657 | |
| 12658 /// @docsEditable true | |
| 12659 EventListenerList get dragStart => this['dragstart']; | |
| 12660 | |
| 12661 /// @docsEditable true | |
| 12662 EventListenerList get drop => this['drop']; | |
| 12663 | |
| 12664 /// @docsEditable true | |
| 12665 EventListenerList get durationChange => this['durationchange']; | 12454 EventListenerList get durationChange => this['durationchange']; |
| 12666 | 12455 |
| 12667 /// @docsEditable true | 12456 /// @docsEditable true |
| 12668 EventListenerList get emptied => this['emptied']; | 12457 EventListenerList get emptied => this['emptied']; |
| 12669 | 12458 |
| 12670 /// @docsEditable true | 12459 /// @docsEditable true |
| 12671 EventListenerList get ended => this['ended']; | 12460 EventListenerList get ended => this['ended']; |
| 12672 | 12461 |
| 12673 /// @docsEditable true | 12462 /// @docsEditable true |
| 12674 EventListenerList get error => this['error']; | |
| 12675 | |
| 12676 /// @docsEditable true | |
| 12677 EventListenerList get focus => this['focus']; | |
| 12678 | |
| 12679 /// @docsEditable true | |
| 12680 EventListenerList get hashChange => this['hashchange']; | |
| 12681 | |
| 12682 /// @docsEditable true | |
| 12683 EventListenerList get input => this['input']; | |
| 12684 | |
| 12685 /// @docsEditable true | |
| 12686 EventListenerList get invalid => this['invalid']; | |
| 12687 | |
| 12688 /// @docsEditable true | |
| 12689 EventListenerList get keyDown => this['keydown']; | |
| 12690 | |
| 12691 /// @docsEditable true | |
| 12692 EventListenerList get keyPress => this['keypress']; | |
| 12693 | |
| 12694 /// @docsEditable true | |
| 12695 EventListenerList get keyUp => this['keyup']; | |
| 12696 | |
| 12697 /// @docsEditable true | |
| 12698 EventListenerList get load => this['load']; | |
| 12699 | |
| 12700 /// @docsEditable true | |
| 12701 EventListenerList get loadedData => this['loadeddata']; | 12463 EventListenerList get loadedData => this['loadeddata']; |
| 12702 | 12464 |
| 12703 /// @docsEditable true | 12465 /// @docsEditable true |
| 12704 EventListenerList get loadedMetadata => this['loadedmetadata']; | 12466 EventListenerList get loadedMetadata => this['loadedmetadata']; |
| 12705 | 12467 |
| 12706 /// @docsEditable true | 12468 /// @docsEditable true |
| 12707 EventListenerList get loadStart => this['loadstart']; | 12469 EventListenerList get loadStart => this['loadstart']; |
| 12708 | 12470 |
| 12709 /// @docsEditable true | 12471 /// @docsEditable true |
| 12710 EventListenerList get message => this['message']; | |
| 12711 | |
| 12712 /// @docsEditable true | |
| 12713 EventListenerList get mouseDown => this['mousedown']; | |
| 12714 | |
| 12715 /// @docsEditable true | |
| 12716 EventListenerList get mouseMove => this['mousemove']; | |
| 12717 | |
| 12718 /// @docsEditable true | |
| 12719 EventListenerList get mouseOut => this['mouseout']; | |
| 12720 | |
| 12721 /// @docsEditable true | |
| 12722 EventListenerList get mouseOver => this['mouseover']; | |
| 12723 | |
| 12724 /// @docsEditable true | |
| 12725 EventListenerList get mouseUp => this['mouseup']; | |
| 12726 | |
| 12727 /// @docsEditable true | |
| 12728 EventListenerList get mouseWheel => this['mousewheel']; | |
| 12729 | |
| 12730 /// @docsEditable true | |
| 12731 EventListenerList get offline => this['offline']; | |
| 12732 | |
| 12733 /// @docsEditable true | |
| 12734 EventListenerList get online => this['online']; | |
| 12735 | |
| 12736 /// @docsEditable true | |
| 12737 EventListenerList get pageHide => this['pagehide']; | |
| 12738 | |
| 12739 /// @docsEditable true | |
| 12740 EventListenerList get pageShow => this['pageshow']; | |
| 12741 | |
| 12742 /// @docsEditable true | |
| 12743 EventListenerList get pause => this['pause']; | 12472 EventListenerList get pause => this['pause']; |
| 12744 | 12473 |
| 12745 /// @docsEditable true | 12474 /// @docsEditable true |
| 12746 EventListenerList get play => this['play']; | 12475 EventListenerList get play => this['play']; |
| 12747 | 12476 |
| 12748 /// @docsEditable true | 12477 /// @docsEditable true |
| 12749 EventListenerList get playing => this['playing']; | 12478 EventListenerList get playing => this['playing']; |
| 12750 | 12479 |
| 12751 /// @docsEditable true | 12480 /// @docsEditable true |
| 12752 EventListenerList get popState => this['popstate']; | |
| 12753 | |
| 12754 /// @docsEditable true | |
| 12755 EventListenerList get progress => this['progress']; | |
| 12756 | |
| 12757 /// @docsEditable true | |
| 12758 EventListenerList get rateChange => this['ratechange']; | |
| 12759 | |
| 12760 /// @docsEditable true | |
| 12761 EventListenerList get reset => this['reset']; | |
| 12762 | |
| 12763 /// @docsEditable true | |
| 12764 EventListenerList get resize => this['resize']; | |
| 12765 | |
| 12766 /// @docsEditable true | |
| 12767 EventListenerList get scroll => this['scroll']; | |
| 12768 | |
| 12769 /// @docsEditable true | |
| 12770 EventListenerList get search => this['search']; | |
| 12771 | |
| 12772 /// @docsEditable true | |
| 12773 EventListenerList get seeked => this['seeked']; | |
| 12774 | |
| 12775 /// @docsEditable true | |
| 12776 EventListenerList get seeking => this['seeking']; | |
| 12777 | |
| 12778 /// @docsEditable true | |
| 12779 EventListenerList get select => this['select']; | |
| 12780 | |
| 12781 /// @docsEditable true | |
| 12782 EventListenerList get stalled => this['stalled']; | |
| 12783 | |
| 12784 /// @docsEditable true | |
| 12785 EventListenerList get storage => this['storage']; | |
| 12786 | |
| 12787 /// @docsEditable true | |
| 12788 EventListenerList get submit => this['submit']; | |
| 12789 | |
| 12790 /// @docsEditable true | |
| 12791 EventListenerList get suspend => this['suspend']; | |
| 12792 | |
| 12793 /// @docsEditable true | |
| 12794 EventListenerList get timeUpdate => this['timeupdate']; | |
| 12795 | |
| 12796 /// @docsEditable true | |
| 12797 EventListenerList get touchCancel => this['touchcancel']; | |
| 12798 | |
| 12799 /// @docsEditable true | |
| 12800 EventListenerList get touchEnd => this['touchend']; | |
| 12801 | |
| 12802 /// @docsEditable true | |
| 12803 EventListenerList get touchMove => this['touchmove']; | |
| 12804 | |
| 12805 /// @docsEditable true | |
| 12806 EventListenerList get touchStart => this['touchstart']; | |
| 12807 | |
| 12808 /// @docsEditable true | |
| 12809 EventListenerList get unload => this['unload']; | |
| 12810 | |
| 12811 /// @docsEditable true | |
| 12812 EventListenerList get volumeChange => this['volumechange']; | |
| 12813 | |
| 12814 /// @docsEditable true | |
| 12815 EventListenerList get waiting => this['waiting']; | |
| 12816 | |
| 12817 /// @docsEditable true | |
| 12818 EventListenerList get animationEnd => this['webkitAnimationEnd']; | |
| 12819 | |
| 12820 /// @docsEditable true | |
| 12821 EventListenerList get animationIteration => this['webkitAnimationIteration']; | |
| 12822 | |
| 12823 /// @docsEditable true | |
| 12824 EventListenerList get animationStart => this['webkitAnimationStart']; | |
| 12825 | |
| 12826 /// @docsEditable true | |
| 12827 EventListenerList get transitionEnd => this['webkitTransitionEnd']; | |
| 12828 } | |
| 12829 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 12830 // for details. All rights reserved. Use of this source code is governed by a | |
| 12831 // BSD-style license that can be found in the LICENSE file. | |
| 12832 | |
| 12833 | |
| 12834 /// @domName HTMLMapElement; @docsEditable true | |
| 12835 class MapElement extends Element native "*HTMLMapElement" { | |
| 12836 | |
| 12837 ///@docsEditable true | |
| 12838 factory MapElement() => document.$dom_createElement("map"); | |
| 12839 | |
| 12840 /// @domName HTMLMapElement.areas; @docsEditable true | |
| 12841 final HtmlCollection areas; | |
| 12842 | |
| 12843 /// @domName HTMLMapElement.name; @docsEditable true | |
| 12844 String name; | |
| 12845 } | |
| 12846 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 12847 // for details. All rights reserved. Use of this source code is governed by a | |
| 12848 // BSD-style license that can be found in the LICENSE file. | |
| 12849 | |
| 12850 | |
| 12851 /// @domName HTMLMarqueeElement; @docsEditable true | |
| 12852 class MarqueeElement extends Element native "*HTMLMarqueeElement" { | |
| 12853 | |
| 12854 /// @domName HTMLMarqueeElement.behavior; @docsEditable true | |
| 12855 String behavior; | |
| 12856 | |
| 12857 /// @domName HTMLMarqueeElement.bgColor; @docsEditable true | |
| 12858 String bgColor; | |
| 12859 | |
| 12860 /// @domName HTMLMarqueeElement.direction; @docsEditable true | |
| 12861 String direction; | |
| 12862 | |
| 12863 /// @domName HTMLMarqueeElement.height; @docsEditable true | |
| 12864 String height; | |
| 12865 | |
| 12866 /// @domName HTMLMarqueeElement.hspace; @docsEditable true | |
| 12867 int hspace; | |
| 12868 | |
| 12869 /// @domName HTMLMarqueeElement.loop; @docsEditable true | |
| 12870 int loop; | |
| 12871 | |
| 12872 /// @domName HTMLMarqueeElement.scrollAmount; @docsEditable true | |
| 12873 int scrollAmount; | |
| 12874 | |
| 12875 /// @domName HTMLMarqueeElement.scrollDelay; @docsEditable true | |
| 12876 int scrollDelay; | |
| 12877 | |
| 12878 /// @domName HTMLMarqueeElement.trueSpeed; @docsEditable true | |
| 12879 bool trueSpeed; | |
| 12880 | |
| 12881 /// @domName HTMLMarqueeElement.vspace; @docsEditable true | |
| 12882 int vspace; | |
| 12883 | |
| 12884 /// @domName HTMLMarqueeElement.width; @docsEditable true | |
| 12885 String width; | |
| 12886 | |
| 12887 /// @domName HTMLMarqueeElement.start; @docsEditable true | |
| 12888 void start() native; | |
| 12889 | |
| 12890 /// @domName HTMLMarqueeElement.stop; @docsEditable true | |
| 12891 void stop() native; | |
| 12892 } | |
| 12893 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 12894 // for details. All rights reserved. Use of this source code is governed by a | |
| 12895 // BSD-style license that can be found in the LICENSE file. | |
| 12896 | |
| 12897 | |
| 12898 /// @domName MediaController; @docsEditable true | |
| 12899 class MediaController extends EventTarget native "*MediaController" { | |
| 12900 | |
| 12901 ///@docsEditable true | |
| 12902 factory MediaController() => _MediaControllerFactoryProvider.createMediaContro
ller(); | |
| 12903 | |
| 12904 /// @domName MediaController.buffered; @docsEditable true | |
| 12905 final TimeRanges buffered; | |
| 12906 | |
| 12907 /// @domName MediaController.currentTime; @docsEditable true | |
| 12908 num currentTime; | |
| 12909 | |
| 12910 /// @domName MediaController.defaultPlaybackRate; @docsEditable true | |
| 12911 num defaultPlaybackRate; | |
| 12912 | |
| 12913 /// @domName MediaController.duration; @docsEditable true | |
| 12914 final num duration; | |
| 12915 | |
| 12916 /// @domName MediaController.muted; @docsEditable true | |
| 12917 bool muted; | |
| 12918 | |
| 12919 /// @domName MediaController.paused; @docsEditable true | |
| 12920 final bool paused; | |
| 12921 | |
| 12922 /// @domName MediaController.playbackRate; @docsEditable true | |
| 12923 num playbackRate; | |
| 12924 | |
| 12925 /// @domName MediaController.played; @docsEditable true | |
| 12926 final TimeRanges played; | |
| 12927 | |
| 12928 /// @domName MediaController.seekable; @docsEditable true | |
| 12929 final TimeRanges seekable; | |
| 12930 | |
| 12931 /// @domName MediaController.volume; @docsEditable true | |
| 12932 num volume; | |
| 12933 | |
| 12934 /// @domName MediaController.addEventListener; @docsEditable true | |
| 12935 @JSName('addEventListener') | |
| 12936 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | |
| 12937 | |
| 12938 /// @domName MediaController.dispatchEvent; @docsEditable true | |
| 12939 @JSName('dispatchEvent') | |
| 12940 bool $dom_dispatchEvent(Event evt) native; | |
| 12941 | |
| 12942 /// @domName MediaController.pause; @docsEditable true | |
| 12943 void pause() native; | |
| 12944 | |
| 12945 /// @domName MediaController.play; @docsEditable true | |
| 12946 void play() native; | |
| 12947 | |
| 12948 /// @domName MediaController.removeEventListener; @docsEditable true | |
| 12949 @JSName('removeEventListener') | |
| 12950 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | |
| 12951 } | |
| 12952 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 12953 // for details. All rights reserved. Use of this source code is governed by a | |
| 12954 // BSD-style license that can be found in the LICENSE file. | |
| 12955 | |
| 12956 | |
| 12957 /// @domName HTMLMediaElement; @docsEditable true | |
| 12958 class MediaElement extends Element native "*HTMLMediaElement" { | |
| 12959 | |
| 12960 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 12961 MediaElementEvents get on => | |
| 12962 new MediaElementEvents(this); | |
| 12963 | |
| 12964 static const int HAVE_CURRENT_DATA = 2; | |
| 12965 | |
| 12966 static const int HAVE_ENOUGH_DATA = 4; | |
| 12967 | |
| 12968 static const int HAVE_FUTURE_DATA = 3; | |
| 12969 | |
| 12970 static const int HAVE_METADATA = 1; | |
| 12971 | |
| 12972 static const int HAVE_NOTHING = 0; | |
| 12973 | |
| 12974 static const int NETWORK_EMPTY = 0; | |
| 12975 | |
| 12976 static const int NETWORK_IDLE = 1; | |
| 12977 | |
| 12978 static const int NETWORK_LOADING = 2; | |
| 12979 | |
| 12980 static const int NETWORK_NO_SOURCE = 3; | |
| 12981 | |
| 12982 /// @domName HTMLMediaElement.autoplay; @docsEditable true | |
| 12983 bool autoplay; | |
| 12984 | |
| 12985 /// @domName HTMLMediaElement.buffered; @docsEditable true | |
| 12986 final TimeRanges buffered; | |
| 12987 | |
| 12988 /// @domName HTMLMediaElement.controller; @docsEditable true | |
| 12989 MediaController controller; | |
| 12990 | |
| 12991 /// @domName HTMLMediaElement.controls; @docsEditable true | |
| 12992 bool controls; | |
| 12993 | |
| 12994 /// @domName HTMLMediaElement.currentSrc; @docsEditable true | |
| 12995 final String currentSrc; | |
| 12996 | |
| 12997 /// @domName HTMLMediaElement.currentTime; @docsEditable true | |
| 12998 num currentTime; | |
| 12999 | |
| 13000 /// @domName HTMLMediaElement.defaultMuted; @docsEditable true | |
| 13001 bool defaultMuted; | |
| 13002 | |
| 13003 /// @domName HTMLMediaElement.defaultPlaybackRate; @docsEditable true | |
| 13004 num defaultPlaybackRate; | |
| 13005 | |
| 13006 /// @domName HTMLMediaElement.duration; @docsEditable true | |
| 13007 final num duration; | |
| 13008 | |
| 13009 /// @domName HTMLMediaElement.ended; @docsEditable true | |
| 13010 final bool ended; | |
| 13011 | |
| 13012 /// @domName HTMLMediaElement.error; @docsEditable true | |
| 13013 final MediaError error; | |
| 13014 | |
| 13015 /// @domName HTMLMediaElement.initialTime; @docsEditable true | |
| 13016 final num initialTime; | |
| 13017 | |
| 13018 /// @domName HTMLMediaElement.loop; @docsEditable true | |
| 13019 bool loop; | |
| 13020 | |
| 13021 /// @domName HTMLMediaElement.mediaGroup; @docsEditable true | |
| 13022 String mediaGroup; | |
| 13023 | |
| 13024 /// @domName HTMLMediaElement.muted; @docsEditable true | |
| 13025 bool muted; | |
| 13026 | |
| 13027 /// @domName HTMLMediaElement.networkState; @docsEditable true | |
| 13028 final int networkState; | |
| 13029 | |
| 13030 /// @domName HTMLMediaElement.paused; @docsEditable true | |
| 13031 final bool paused; | |
| 13032 | |
| 13033 /// @domName HTMLMediaElement.playbackRate; @docsEditable true | |
| 13034 num playbackRate; | |
| 13035 | |
| 13036 /// @domName HTMLMediaElement.played; @docsEditable true | |
| 13037 final TimeRanges played; | |
| 13038 | |
| 13039 /// @domName HTMLMediaElement.preload; @docsEditable true | |
| 13040 String preload; | |
| 13041 | |
| 13042 /// @domName HTMLMediaElement.readyState; @docsEditable true | |
| 13043 final int readyState; | |
| 13044 | |
| 13045 /// @domName HTMLMediaElement.seekable; @docsEditable true | |
| 13046 final TimeRanges seekable; | |
| 13047 | |
| 13048 /// @domName HTMLMediaElement.seeking; @docsEditable true | |
| 13049 final bool seeking; | |
| 13050 | |
| 13051 /// @domName HTMLMediaElement.src; @docsEditable true | |
| 13052 String src; | |
| 13053 | |
| 13054 /// @domName HTMLMediaElement.startTime; @docsEditable true | |
| 13055 final num startTime; | |
| 13056 | |
| 13057 /// @domName HTMLMediaElement.textTracks; @docsEditable true | |
| 13058 final TextTrackList textTracks; | |
| 13059 | |
| 13060 /// @domName HTMLMediaElement.volume; @docsEditable true | |
| 13061 num volume; | |
| 13062 | |
| 13063 /// @domName HTMLMediaElement.webkitAudioDecodedByteCount; @docsEditable true | |
| 13064 final int webkitAudioDecodedByteCount; | |
| 13065 | |
| 13066 /// @domName HTMLMediaElement.webkitClosedCaptionsVisible; @docsEditable true | |
| 13067 bool webkitClosedCaptionsVisible; | |
| 13068 | |
| 13069 /// @domName HTMLMediaElement.webkitHasClosedCaptions; @docsEditable true | |
| 13070 final bool webkitHasClosedCaptions; | |
| 13071 | |
| 13072 /// @domName HTMLMediaElement.webkitPreservesPitch; @docsEditable true | |
| 13073 bool webkitPreservesPitch; | |
| 13074 | |
| 13075 /// @domName HTMLMediaElement.webkitVideoDecodedByteCount; @docsEditable true | |
| 13076 final int webkitVideoDecodedByteCount; | |
| 13077 | |
| 13078 /// @domName HTMLMediaElement.addTextTrack; @docsEditable true | |
| 13079 TextTrack addTextTrack(String kind, [String label, String language]) native; | |
| 13080 | |
| 13081 /// @domName HTMLMediaElement.canPlayType; @docsEditable true | |
| 13082 String canPlayType(String type, String keySystem) native; | |
| 13083 | |
| 13084 /// @domName HTMLMediaElement.load; @docsEditable true | |
| 13085 void load() native; | |
| 13086 | |
| 13087 /// @domName HTMLMediaElement.pause; @docsEditable true | |
| 13088 void pause() native; | |
| 13089 | |
| 13090 /// @domName HTMLMediaElement.play; @docsEditable true | |
| 13091 void play() native; | |
| 13092 | |
| 13093 /// @domName HTMLMediaElement.webkitAddKey; @docsEditable true | |
| 13094 void webkitAddKey(String keySystem, Uint8Array key, [Uint8Array initData, Stri
ng sessionId]) native; | |
| 13095 | |
| 13096 /// @domName HTMLMediaElement.webkitCancelKeyRequest; @docsEditable true | |
| 13097 void webkitCancelKeyRequest(String keySystem, String sessionId) native; | |
| 13098 | |
| 13099 /// @domName HTMLMediaElement.webkitGenerateKeyRequest; @docsEditable true | |
| 13100 void webkitGenerateKeyRequest(String keySystem, [Uint8Array initData]) native; | |
| 13101 } | |
| 13102 | |
| 13103 /// @docsEditable true | |
| 13104 class MediaElementEvents extends ElementEvents { | |
| 13105 /// @docsEditable true | |
| 13106 MediaElementEvents(EventTarget _ptr) : super(_ptr); | |
| 13107 | |
| 13108 /// @docsEditable true | |
| 13109 EventListenerList get canPlay => this['canplay']; | |
| 13110 | |
| 13111 /// @docsEditable true | |
| 13112 EventListenerList get canPlayThrough => this['canplaythrough']; | |
| 13113 | |
| 13114 /// @docsEditable true | |
| 13115 EventListenerList get durationChange => this['durationchange']; | |
| 13116 | |
| 13117 /// @docsEditable true | |
| 13118 EventListenerList get emptied => this['emptied']; | |
| 13119 | |
| 13120 /// @docsEditable true | |
| 13121 EventListenerList get ended => this['ended']; | |
| 13122 | |
| 13123 /// @docsEditable true | |
| 13124 EventListenerList get loadedData => this['loadeddata']; | |
| 13125 | |
| 13126 /// @docsEditable true | |
| 13127 EventListenerList get loadedMetadata => this['loadedmetadata']; | |
| 13128 | |
| 13129 /// @docsEditable true | |
| 13130 EventListenerList get loadStart => this['loadstart']; | |
| 13131 | |
| 13132 /// @docsEditable true | |
| 13133 EventListenerList get pause => this['pause']; | |
| 13134 | |
| 13135 /// @docsEditable true | |
| 13136 EventListenerList get play => this['play']; | |
| 13137 | |
| 13138 /// @docsEditable true | |
| 13139 EventListenerList get playing => this['playing']; | |
| 13140 | |
| 13141 /// @docsEditable true | |
| 13142 EventListenerList get progress => this['progress']; | 12481 EventListenerList get progress => this['progress']; |
| 13143 | 12482 |
| 13144 /// @docsEditable true | 12483 /// @docsEditable true |
| 13145 EventListenerList get rateChange => this['ratechange']; | 12484 EventListenerList get rateChange => this['ratechange']; |
| 13146 | 12485 |
| 13147 /// @docsEditable true | 12486 /// @docsEditable true |
| 13148 EventListenerList get seeked => this['seeked']; | 12487 EventListenerList get seeked => this['seeked']; |
| 13149 | 12488 |
| 13150 /// @docsEditable true | 12489 /// @docsEditable true |
| 13151 EventListenerList get seeking => this['seeking']; | 12490 EventListenerList get seeking => this['seeking']; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13604 final String lastEventId; | 12943 final String lastEventId; |
| 13605 | 12944 |
| 13606 /// @domName MessageEvent.origin; @docsEditable true | 12945 /// @domName MessageEvent.origin; @docsEditable true |
| 13607 final String origin; | 12946 final String origin; |
| 13608 | 12947 |
| 13609 /// @domName MessageEvent.ports; @docsEditable true | 12948 /// @domName MessageEvent.ports; @docsEditable true |
| 13610 @Creates('=List') | 12949 @Creates('=List') |
| 13611 final List ports; | 12950 final List ports; |
| 13612 | 12951 |
| 13613 /// @domName MessageEvent.source; @docsEditable true | 12952 /// @domName MessageEvent.source; @docsEditable true |
| 13614 Window get source => _convertNativeToDart_Window(this._source); | 12953 WindowBase get source => _convertNativeToDart_Window(this._source); |
| 13615 @JSName('source') | 12954 @JSName('source') |
| 13616 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 12955 @Creates('Window|=Object') @Returns('Window|=Object') |
| 13617 final dynamic _source; | 12956 final dynamic _source; |
| 13618 | 12957 |
| 13619 /// @domName MessageEvent.initMessageEvent; @docsEditable true | 12958 /// @domName MessageEvent.initMessageEvent; @docsEditable true |
| 13620 void initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, O
bject dataArg, String originArg, String lastEventIdArg, LocalWindow sourceArg, L
ist messagePorts) native; | 12959 void initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, O
bject dataArg, String originArg, String lastEventIdArg, Window sourceArg, List m
essagePorts) native; |
| 13621 | 12960 |
| 13622 /// @domName MessageEvent.webkitInitMessageEvent; @docsEditable true | 12961 /// @domName MessageEvent.webkitInitMessageEvent; @docsEditable true |
| 13623 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable
Arg, Object dataArg, String originArg, String lastEventIdArg, LocalWindow source
Arg, List transferables) native; | 12962 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable
Arg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg,
List transferables) native; |
| 13624 } | 12963 } |
| 13625 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 12964 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 13626 // for details. All rights reserved. Use of this source code is governed by a | 12965 // for details. All rights reserved. Use of this source code is governed by a |
| 13627 // BSD-style license that can be found in the LICENSE file. | 12966 // BSD-style license that can be found in the LICENSE file. |
| 13628 | 12967 |
| 13629 | 12968 |
| 13630 /// @domName MessagePort; @docsEditable true | 12969 /// @domName MessagePort; @docsEditable true |
| 13631 class MessagePort extends EventTarget native "*MessagePort" { | 12970 class MessagePort extends EventTarget native "*MessagePort" { |
| 13632 | 12971 |
| 13633 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | 12972 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13832 /// @domName MouseEvent.webkitMovementY; @docsEditable true | 13171 /// @domName MouseEvent.webkitMovementY; @docsEditable true |
| 13833 final int webkitMovementY; | 13172 final int webkitMovementY; |
| 13834 | 13173 |
| 13835 /// @domName MouseEvent.x; @docsEditable true | 13174 /// @domName MouseEvent.x; @docsEditable true |
| 13836 final int x; | 13175 final int x; |
| 13837 | 13176 |
| 13838 /// @domName MouseEvent.y; @docsEditable true | 13177 /// @domName MouseEvent.y; @docsEditable true |
| 13839 final int y; | 13178 final int y; |
| 13840 | 13179 |
| 13841 /// @domName MouseEvent.initMouseEvent; @docsEditable true | 13180 /// @domName MouseEvent.initMouseEvent; @docsEditable true |
| 13842 void $dom_initMouseEvent(String type, bool canBubble, bool cancelable, LocalWi
ndow view, int detail, int screenX, int screenY, int clientX, int clientY, bool
ctrlKey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relat
edTarget) { | 13181 void $dom_initMouseEvent(String type, bool canBubble, bool cancelable, Window
view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlK
ey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relatedTar
get) { |
| 13843 var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget); | 13182 var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget); |
| 13844 _$dom_initMouseEvent_1(type, canBubble, cancelable, view, detail, screenX, s
creenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTar
get_1); | 13183 _$dom_initMouseEvent_1(type, canBubble, cancelable, view, detail, screenX, s
creenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTar
get_1); |
| 13845 return; | 13184 return; |
| 13846 } | 13185 } |
| 13847 @JSName('initMouseEvent') | 13186 @JSName('initMouseEvent') |
| 13848 void _$dom_initMouseEvent_1(type, canBubble, cancelable, LocalWindow view, det
ail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, but
ton, relatedTarget) native; | 13187 void _$dom_initMouseEvent_1(type, canBubble, cancelable, Window view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button,
relatedTarget) native; |
| 13849 | 13188 |
| 13850 | 13189 |
| 13851 int get offsetX { | 13190 int get offsetX { |
| 13852 if (JS('bool', '!!#.offsetX', this)) { | 13191 if (JS('bool', '!!#.offsetX', this)) { |
| 13853 return JS('int', '#.offsetX', this); | 13192 return JS('int', '#.offsetX', this); |
| 13854 } else { | 13193 } else { |
| 13855 // Firefox does not support offsetX. | 13194 // Firefox does not support offsetX. |
| 13856 var target = this.target; | 13195 var target = this.target; |
| 13857 if (!(target is Element)) { | 13196 if (!(target is Element)) { |
| 13858 throw new UnsupportedError( | 13197 throw new UnsupportedError( |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14353 void forEach(void f(Node element)) => Collections.forEach(this, f); | 13692 void forEach(void f(Node element)) => Collections.forEach(this, f); |
| 14354 | 13693 |
| 14355 dynamic reduce(dynamic initialValue, | 13694 dynamic reduce(dynamic initialValue, |
| 14356 dynamic combine(dynamic previousValue, Node element)) { | 13695 dynamic combine(dynamic previousValue, Node element)) { |
| 14357 return Collections.reduce(this, initialValue, combine); | 13696 return Collections.reduce(this, initialValue, combine); |
| 14358 } | 13697 } |
| 14359 | 13698 |
| 14360 Collection map(f(Node element)) => Collections.map(this, [], f); | 13699 Collection map(f(Node element)) => Collections.map(this, [], f); |
| 14361 | 13700 |
| 14362 Collection<Node> filter(bool f(Node element)) => | 13701 Collection<Node> filter(bool f(Node element)) => |
| 13702 Collections.filter(this, <Node>[], f); |
| 13703 |
| 13704 bool every(bool f(Node element)) => Collections.every(this, f); |
| 13705 |
| 13706 bool some(bool f(Node element)) => Collections.some(this, f); |
| 13707 |
| 13708 bool get isEmpty => this.length == 0; |
| 13709 |
| 13710 // From List<Node>: |
| 13711 |
| 13712 // TODO(jacobr): this could be implemented for child node lists. |
| 13713 // The exception we throw here is misleading. |
| 13714 void sort([int compare(Node a, Node b)]) { |
| 13715 throw new UnsupportedError("Cannot sort immutable List."); |
| 13716 } |
| 13717 |
| 13718 int indexOf(Node element, [int start = 0]) => |
| 13719 Lists.indexOf(this, element, start, this.length); |
| 13720 |
| 13721 int lastIndexOf(Node element, [int start = 0]) => |
| 13722 Lists.lastIndexOf(this, element, start); |
| 13723 |
| 13724 // FIXME: implement these. |
| 13725 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { |
| 13726 throw new UnsupportedError( |
| 13727 "Cannot setRange on immutable List."); |
| 13728 } |
| 13729 void removeRange(int start, int rangeLength) { |
| 13730 throw new UnsupportedError( |
| 13731 "Cannot removeRange on immutable List."); |
| 13732 } |
| 13733 void insertRange(int start, int rangeLength, [Node initialValue]) { |
| 13734 throw new UnsupportedError( |
| 13735 "Cannot insertRange on immutable List."); |
| 13736 } |
| 13737 List<Node> getRange(int start, int rangeLength) => |
| 13738 Lists.getRange(this, start, rangeLength, <Node>[]); |
| 13739 |
| 13740 // -- end List<Node> mixins. |
| 13741 |
| 13742 // TODO(jacobr): benchmark whether this is more efficient or whether caching |
| 13743 // a local copy of $dom_childNodes is more efficient. |
| 13744 int get length => _this.$dom_childNodes.length; |
| 13745 |
| 13746 void set length(int value) { |
| 13747 throw new UnsupportedError( |
| 13748 "Cannot set length on immutable List."); |
| 13749 } |
| 13750 |
| 13751 Node operator[](int index) => _this.$dom_childNodes[index]; |
| 13752 } |
| 13753 |
| 13754 /// @domName Node |
| 13755 class Node extends EventTarget native "*Node" { |
| 13756 List<Node> get nodes { |
| 13757 return new _ChildNodeListLazy(this); |
| 13758 } |
| 13759 |
| 13760 void set nodes(Collection<Node> value) { |
| 13761 // Copy list first since we don't want liveness during iteration. |
| 13762 // TODO(jacobr): there is a better way to do this. |
| 13763 List copy = new List.from(value); |
| 13764 text = ''; |
| 13765 for (Node node in copy) { |
| 13766 $dom_appendChild(node); |
| 13767 } |
| 13768 } |
| 13769 |
| 13770 /** |
| 13771 * Removes this node from the DOM. |
| 13772 * @domName Node.removeChild |
| 13773 */ |
| 13774 void remove() { |
| 13775 // TODO(jacobr): should we throw an exception if parent is already null? |
| 13776 // TODO(vsm): Use the native remove when available. |
| 13777 if (this.parentNode != null) { |
| 13778 final Node parent = this.parentNode; |
| 13779 parentNode.$dom_removeChild(this); |
| 13780 } |
| 13781 } |
| 13782 |
| 13783 /** |
| 13784 * Replaces this node with another node. |
| 13785 * @domName Node.replaceChild |
| 13786 */ |
| 13787 Node replaceWith(Node otherNode) { |
| 13788 try { |
| 13789 final Node parent = this.parentNode; |
| 13790 parent.$dom_replaceChild(otherNode, this); |
| 13791 } catch (e) { |
| 13792 |
| 13793 }; |
| 13794 return this; |
| 13795 } |
| 13796 |
| 13797 |
| 13798 static const int ATTRIBUTE_NODE = 2; |
| 13799 |
| 13800 static const int CDATA_SECTION_NODE = 4; |
| 13801 |
| 13802 static const int COMMENT_NODE = 8; |
| 13803 |
| 13804 static const int DOCUMENT_FRAGMENT_NODE = 11; |
| 13805 |
| 13806 static const int DOCUMENT_NODE = 9; |
| 13807 |
| 13808 static const int DOCUMENT_POSITION_CONTAINED_BY = 0x10; |
| 13809 |
| 13810 static const int DOCUMENT_POSITION_CONTAINS = 0x08; |
| 13811 |
| 13812 static const int DOCUMENT_POSITION_DISCONNECTED = 0x01; |
| 13813 |
| 13814 static const int DOCUMENT_POSITION_FOLLOWING = 0x04; |
| 13815 |
| 13816 static const int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; |
| 13817 |
| 13818 static const int DOCUMENT_POSITION_PRECEDING = 0x02; |
| 13819 |
| 13820 static const int DOCUMENT_TYPE_NODE = 10; |
| 13821 |
| 13822 static const int ELEMENT_NODE = 1; |
| 13823 |
| 13824 static const int ENTITY_NODE = 6; |
| 13825 |
| 13826 static const int ENTITY_REFERENCE_NODE = 5; |
| 13827 |
| 13828 static const int NOTATION_NODE = 12; |
| 13829 |
| 13830 static const int PROCESSING_INSTRUCTION_NODE = 7; |
| 13831 |
| 13832 static const int TEXT_NODE = 3; |
| 13833 |
| 13834 /// @domName Node.attributes; @docsEditable true |
| 13835 @JSName('attributes') |
| 13836 final NamedNodeMap $dom_attributes; |
| 13837 |
| 13838 /// @domName Node.childNodes; @docsEditable true |
| 13839 @JSName('childNodes') |
| 13840 @Returns('NodeList') @Creates('NodeList') |
| 13841 final List<Node> $dom_childNodes; |
| 13842 |
| 13843 /// @domName Node.firstChild; @docsEditable true |
| 13844 @JSName('firstChild') |
| 13845 final Node $dom_firstChild; |
| 13846 |
| 13847 /// @domName Node.lastChild; @docsEditable true |
| 13848 @JSName('lastChild') |
| 13849 final Node $dom_lastChild; |
| 13850 |
| 13851 /// @domName Node.localName; @docsEditable true |
| 13852 @JSName('localName') |
| 13853 final String $dom_localName; |
| 13854 |
| 13855 /// @domName Node.namespaceURI; @docsEditable true |
| 13856 @JSName('namespaceURI') |
| 13857 final String $dom_namespaceUri; |
| 13858 |
| 13859 /// @domName Node.nextSibling; @docsEditable true |
| 13860 @JSName('nextSibling') |
| 13861 final Node nextNode; |
| 13862 |
| 13863 /// @domName Node.nodeType; @docsEditable true |
| 13864 final int nodeType; |
| 13865 |
| 13866 /// @domName Node.ownerDocument; @docsEditable true |
| 13867 @JSName('ownerDocument') |
| 13868 final Document document; |
| 13869 |
| 13870 /// @domName Node.parentElement; @docsEditable true |
| 13871 @JSName('parentElement') |
| 13872 final Element parent; |
| 13873 |
| 13874 /// @domName Node.parentNode; @docsEditable true |
| 13875 final Node parentNode; |
| 13876 |
| 13877 /// @domName Node.previousSibling; @docsEditable true |
| 13878 @JSName('previousSibling') |
| 13879 final Node previousNode; |
| 13880 |
| 13881 /// @domName Node.textContent; @docsEditable true |
| 13882 @JSName('textContent') |
| 13883 String text; |
| 13884 |
| 13885 /// @domName Node.addEventListener; @docsEditable true |
| 13886 @JSName('addEventListener') |
| 13887 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 13888 |
| 13889 /// @domName Node.appendChild; @docsEditable true |
| 13890 @JSName('appendChild') |
| 13891 Node $dom_appendChild(Node newChild) native; |
| 13892 |
| 13893 /// @domName Node.cloneNode; @docsEditable true |
| 13894 @JSName('cloneNode') |
| 13895 Node clone(bool deep) native; |
| 13896 |
| 13897 /// @domName Node.contains; @docsEditable true |
| 13898 bool contains(Node other) native; |
| 13899 |
| 13900 /// @domName Node.dispatchEvent; @docsEditable true |
| 13901 @JSName('dispatchEvent') |
| 13902 bool $dom_dispatchEvent(Event event) native; |
| 13903 |
| 13904 /// @domName Node.hasChildNodes; @docsEditable true |
| 13905 bool hasChildNodes() native; |
| 13906 |
| 13907 /// @domName Node.insertBefore; @docsEditable true |
| 13908 Node insertBefore(Node newChild, Node refChild) native; |
| 13909 |
| 13910 /// @domName Node.removeChild; @docsEditable true |
| 13911 @JSName('removeChild') |
| 13912 Node $dom_removeChild(Node oldChild) native; |
| 13913 |
| 13914 /// @domName Node.removeEventListener; @docsEditable true |
| 13915 @JSName('removeEventListener') |
| 13916 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 13917 |
| 13918 /// @domName Node.replaceChild; @docsEditable true |
| 13919 @JSName('replaceChild') |
| 13920 Node $dom_replaceChild(Node newChild, Node oldChild) native; |
| 13921 |
| 13922 } |
| 13923 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 13924 // for details. All rights reserved. Use of this source code is governed by a |
| 13925 // BSD-style license that can be found in the LICENSE file. |
| 13926 |
| 13927 |
| 13928 /// @domName NodeFilter; @docsEditable true |
| 13929 class NodeFilter native "*NodeFilter" { |
| 13930 |
| 13931 static const int FILTER_ACCEPT = 1; |
| 13932 |
| 13933 static const int FILTER_REJECT = 2; |
| 13934 |
| 13935 static const int FILTER_SKIP = 3; |
| 13936 |
| 13937 static const int SHOW_ALL = 0xFFFFFFFF; |
| 13938 |
| 13939 static const int SHOW_ATTRIBUTE = 0x00000002; |
| 13940 |
| 13941 static const int SHOW_CDATA_SECTION = 0x00000008; |
| 13942 |
| 13943 static const int SHOW_COMMENT = 0x00000080; |
| 13944 |
| 13945 static const int SHOW_DOCUMENT = 0x00000100; |
| 13946 |
| 13947 static const int SHOW_DOCUMENT_FRAGMENT = 0x00000400; |
| 13948 |
| 13949 static const int SHOW_DOCUMENT_TYPE = 0x00000200; |
| 13950 |
| 13951 static const int SHOW_ELEMENT = 0x00000001; |
| 13952 |
| 13953 static const int SHOW_ENTITY = 0x00000020; |
| 13954 |
| 13955 static const int SHOW_ENTITY_REFERENCE = 0x00000010; |
| 13956 |
| 13957 static const int SHOW_NOTATION = 0x00000800; |
| 13958 |
| 13959 static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040; |
| 13960 |
| 13961 static const int SHOW_TEXT = 0x00000004; |
| 13962 |
| 13963 /// @domName NodeFilter.acceptNode; @docsEditable true |
| 13964 int acceptNode(Node n) native; |
| 13965 } |
| 13966 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 13967 // for details. All rights reserved. Use of this source code is governed by a |
| 13968 // BSD-style license that can be found in the LICENSE file. |
| 13969 |
| 13970 |
| 13971 /// @domName NodeIterator; @docsEditable true |
| 13972 class NodeIterator native "*NodeIterator" { |
| 13973 |
| 13974 /// @domName NodeIterator.expandEntityReferences; @docsEditable true |
| 13975 final bool expandEntityReferences; |
| 13976 |
| 13977 /// @domName NodeIterator.filter; @docsEditable true |
| 13978 final NodeFilter filter; |
| 13979 |
| 13980 /// @domName NodeIterator.pointerBeforeReferenceNode; @docsEditable true |
| 13981 final bool pointerBeforeReferenceNode; |
| 13982 |
| 13983 /// @domName NodeIterator.referenceNode; @docsEditable true |
| 13984 final Node referenceNode; |
| 13985 |
| 13986 /// @domName NodeIterator.root; @docsEditable true |
| 13987 final Node root; |
| 13988 |
| 13989 /// @domName NodeIterator.whatToShow; @docsEditable true |
| 13990 final int whatToShow; |
| 13991 |
| 13992 /// @domName NodeIterator.detach; @docsEditable true |
| 13993 void detach() native; |
| 13994 |
| 13995 /// @domName NodeIterator.nextNode; @docsEditable true |
| 13996 Node nextNode() native; |
| 13997 |
| 13998 /// @domName NodeIterator.previousNode; @docsEditable true |
| 13999 Node previousNode() native; |
| 14000 } |
| 14001 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 14002 // for details. All rights reserved. Use of this source code is governed by a |
| 14003 // BSD-style license that can be found in the LICENSE file. |
| 14004 |
| 14005 |
| 14006 /// @domName NodeList; @docsEditable true |
| 14007 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi
st" { |
| 14008 |
| 14009 /// @domName NodeList.length; @docsEditable true |
| 14010 int get length => JS("int", "#.length", this); |
| 14011 |
| 14012 Node operator[](int index) => JS("Node", "#[#]", this, index); |
| 14013 |
| 14014 void operator[]=(int index, Node value) { |
| 14015 throw new UnsupportedError("Cannot assign element of immutable List."); |
| 14016 } |
| 14017 // -- start List<Node> mixins. |
| 14018 // Node is the element type. |
| 14019 |
| 14020 // From Iterable<Node>: |
| 14021 |
| 14022 Iterator<Node> iterator() { |
| 14023 // Note: NodeLists are not fixed size. And most probably length shouldn't |
| 14024 // be cached in both iterator _and_ forEach method. For now caching it |
| 14025 // for consistency. |
| 14026 return new FixedSizeListIterator<Node>(this); |
| 14027 } |
| 14028 |
| 14029 // From Collection<Node>: |
| 14030 |
| 14031 void add(Node value) { |
| 14032 throw new UnsupportedError("Cannot add to immutable List."); |
| 14033 } |
| 14034 |
| 14035 void addLast(Node value) { |
| 14036 throw new UnsupportedError("Cannot add to immutable List."); |
| 14037 } |
| 14038 |
| 14039 void addAll(Collection<Node> collection) { |
| 14040 throw new UnsupportedError("Cannot add to immutable List."); |
| 14041 } |
| 14042 |
| 14043 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) { |
| 14044 return Collections.reduce(this, initialValue, combine); |
| 14045 } |
| 14046 |
| 14047 bool contains(Node element) => Collections.contains(this, element); |
| 14048 |
| 14049 void forEach(void f(Node element)) => Collections.forEach(this, f); |
| 14050 |
| 14051 Collection map(f(Node element)) => Collections.map(this, [], f); |
| 14052 |
| 14053 Collection<Node> filter(bool f(Node element)) => |
| 14363 Collections.filter(this, <Node>[], f); | 14054 Collections.filter(this, <Node>[], f); |
| 14364 | 14055 |
| 14365 bool every(bool f(Node element)) => Collections.every(this, f); | 14056 bool every(bool f(Node element)) => Collections.every(this, f); |
| 14366 | 14057 |
| 14367 bool some(bool f(Node element)) => Collections.some(this, f); | 14058 bool some(bool f(Node element)) => Collections.some(this, f); |
| 14368 | 14059 |
| 14369 bool get isEmpty => this.length == 0; | 14060 bool get isEmpty => this.length == 0; |
| 14370 | 14061 |
| 14371 // From List<Node>: | 14062 // From List<Node>: |
| 14063 void set length(int value) { |
| 14064 throw new UnsupportedError("Cannot resize immutable List."); |
| 14065 } |
| 14372 | 14066 |
| 14373 // TODO(jacobr): this could be implemented for child node lists. | 14067 void clear() { |
| 14374 // The exception we throw here is misleading. | 14068 throw new UnsupportedError("Cannot clear immutable List."); |
| 14069 } |
| 14070 |
| 14375 void sort([int compare(Node a, Node b)]) { | 14071 void sort([int compare(Node a, Node b)]) { |
| 14376 throw new UnsupportedError("Cannot sort immutable List."); | 14072 throw new UnsupportedError("Cannot sort immutable List."); |
| 14377 } | 14073 } |
| 14378 | 14074 |
| 14379 int indexOf(Node element, [int start = 0]) => | 14075 int indexOf(Node element, [int start = 0]) => |
| 14380 Lists.indexOf(this, element, start, this.length); | 14076 Lists.indexOf(this, element, start, this.length); |
| 14381 | 14077 |
| 14382 int lastIndexOf(Node element, [int start = 0]) => | |
| 14383 Lists.lastIndexOf(this, element, start); | |
| 14384 | |
| 14385 // FIXME: implement these. | |
| 14386 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { | |
| 14387 throw new UnsupportedError( | |
| 14388 "Cannot setRange on immutable List."); | |
| 14389 } | |
| 14390 void removeRange(int start, int rangeLength) { | |
| 14391 throw new UnsupportedError( | |
| 14392 "Cannot removeRange on immutable List."); | |
| 14393 } | |
| 14394 void insertRange(int start, int rangeLength, [Node initialValue]) { | |
| 14395 throw new UnsupportedError( | |
| 14396 "Cannot insertRange on immutable List."); | |
| 14397 } | |
| 14398 List<Node> getRange(int start, int rangeLength) => | |
| 14399 Lists.getRange(this, start, rangeLength, <Node>[]); | |
| 14400 | |
| 14401 // -- end List<Node> mixins. | |
| 14402 | |
| 14403 // TODO(jacobr): benchmark whether this is more efficient or whether caching | |
| 14404 // a local copy of $dom_childNodes is more efficient. | |
| 14405 int get length => _this.$dom_childNodes.length; | |
| 14406 | |
| 14407 void set length(int value) { | |
| 14408 throw new UnsupportedError( | |
| 14409 "Cannot set length on immutable List."); | |
| 14410 } | |
| 14411 | |
| 14412 Node operator[](int index) => _this.$dom_childNodes[index]; | |
| 14413 } | |
| 14414 | |
| 14415 /// @domName Node | |
| 14416 class Node extends EventTarget native "*Node" { | |
| 14417 List<Node> get nodes { | |
| 14418 return new _ChildNodeListLazy(this); | |
| 14419 } | |
| 14420 | |
| 14421 void set nodes(Collection<Node> value) { | |
| 14422 // Copy list first since we don't want liveness during iteration. | |
| 14423 // TODO(jacobr): there is a better way to do this. | |
| 14424 List copy = new List.from(value); | |
| 14425 text = ''; | |
| 14426 for (Node node in copy) { | |
| 14427 $dom_appendChild(node); | |
| 14428 } | |
| 14429 } | |
| 14430 | |
| 14431 /** | |
| 14432 * Removes this node from the DOM. | |
| 14433 * @domName Node.removeChild | |
| 14434 */ | |
| 14435 void remove() { | |
| 14436 // TODO(jacobr): should we throw an exception if parent is already null? | |
| 14437 // TODO(vsm): Use the native remove when available. | |
| 14438 if (this.parentNode != null) { | |
| 14439 final Node parent = this.parentNode; | |
| 14440 parentNode.$dom_removeChild(this); | |
| 14441 } | |
| 14442 } | |
| 14443 | |
| 14444 /** | |
| 14445 * Replaces this node with another node. | |
| 14446 * @domName Node.replaceChild | |
| 14447 */ | |
| 14448 Node replaceWith(Node otherNode) { | |
| 14449 try { | |
| 14450 final Node parent = this.parentNode; | |
| 14451 parent.$dom_replaceChild(otherNode, this); | |
| 14452 } catch (e) { | |
| 14453 | |
| 14454 }; | |
| 14455 return this; | |
| 14456 } | |
| 14457 | |
| 14458 | |
| 14459 static const int ATTRIBUTE_NODE = 2; | |
| 14460 | |
| 14461 static const int CDATA_SECTION_NODE = 4; | |
| 14462 | |
| 14463 static const int COMMENT_NODE = 8; | |
| 14464 | |
| 14465 static const int DOCUMENT_FRAGMENT_NODE = 11; | |
| 14466 | |
| 14467 static const int DOCUMENT_NODE = 9; | |
| 14468 | |
| 14469 static const int DOCUMENT_POSITION_CONTAINED_BY = 0x10; | |
| 14470 | |
| 14471 static const int DOCUMENT_POSITION_CONTAINS = 0x08; | |
| 14472 | |
| 14473 static const int DOCUMENT_POSITION_DISCONNECTED = 0x01; | |
| 14474 | |
| 14475 static const int DOCUMENT_POSITION_FOLLOWING = 0x04; | |
| 14476 | |
| 14477 static const int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; | |
| 14478 | |
| 14479 static const int DOCUMENT_POSITION_PRECEDING = 0x02; | |
| 14480 | |
| 14481 static const int DOCUMENT_TYPE_NODE = 10; | |
| 14482 | |
| 14483 static const int ELEMENT_NODE = 1; | |
| 14484 | |
| 14485 static const int ENTITY_NODE = 6; | |
| 14486 | |
| 14487 static const int ENTITY_REFERENCE_NODE = 5; | |
| 14488 | |
| 14489 static const int NOTATION_NODE = 12; | |
| 14490 | |
| 14491 static const int PROCESSING_INSTRUCTION_NODE = 7; | |
| 14492 | |
| 14493 static const int TEXT_NODE = 3; | |
| 14494 | |
| 14495 /// @domName Node.attributes; @docsEditable true | |
| 14496 @JSName('attributes') | |
| 14497 final NamedNodeMap $dom_attributes; | |
| 14498 | |
| 14499 /// @domName Node.childNodes; @docsEditable true | |
| 14500 @JSName('childNodes') | |
| 14501 @Returns('NodeList') @Creates('NodeList') | |
| 14502 final List<Node> $dom_childNodes; | |
| 14503 | |
| 14504 /// @domName Node.firstChild; @docsEditable true | |
| 14505 @JSName('firstChild') | |
| 14506 final Node $dom_firstChild; | |
| 14507 | |
| 14508 /// @domName Node.lastChild; @docsEditable true | |
| 14509 @JSName('lastChild') | |
| 14510 final Node $dom_lastChild; | |
| 14511 | |
| 14512 /// @domName Node.localName; @docsEditable true | |
| 14513 @JSName('localName') | |
| 14514 final String $dom_localName; | |
| 14515 | |
| 14516 /// @domName Node.namespaceURI; @docsEditable true | |
| 14517 @JSName('namespaceURI') | |
| 14518 final String $dom_namespaceUri; | |
| 14519 | |
| 14520 /// @domName Node.nextSibling; @docsEditable true | |
| 14521 @JSName('nextSibling') | |
| 14522 final Node nextNode; | |
| 14523 | |
| 14524 /// @domName Node.nodeType; @docsEditable true | |
| 14525 final int nodeType; | |
| 14526 | |
| 14527 /// @domName Node.ownerDocument; @docsEditable true | |
| 14528 @JSName('ownerDocument') | |
| 14529 final Document document; | |
| 14530 | |
| 14531 /// @domName Node.parentElement; @docsEditable true | |
| 14532 @JSName('parentElement') | |
| 14533 final Element parent; | |
| 14534 | |
| 14535 /// @domName Node.parentNode; @docsEditable true | |
| 14536 final Node parentNode; | |
| 14537 | |
| 14538 /// @domName Node.previousSibling; @docsEditable true | |
| 14539 @JSName('previousSibling') | |
| 14540 final Node previousNode; | |
| 14541 | |
| 14542 /// @domName Node.textContent; @docsEditable true | |
| 14543 @JSName('textContent') | |
| 14544 String text; | |
| 14545 | |
| 14546 /// @domName Node.addEventListener; @docsEditable true | |
| 14547 @JSName('addEventListener') | |
| 14548 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | |
| 14549 | |
| 14550 /// @domName Node.appendChild; @docsEditable true | |
| 14551 @JSName('appendChild') | |
| 14552 Node $dom_appendChild(Node newChild) native; | |
| 14553 | |
| 14554 /// @domName Node.cloneNode; @docsEditable true | |
| 14555 @JSName('cloneNode') | |
| 14556 Node clone(bool deep) native; | |
| 14557 | |
| 14558 /// @domName Node.contains; @docsEditable true | |
| 14559 bool contains(Node other) native; | |
| 14560 | |
| 14561 /// @domName Node.dispatchEvent; @docsEditable true | |
| 14562 @JSName('dispatchEvent') | |
| 14563 bool $dom_dispatchEvent(Event event) native; | |
| 14564 | |
| 14565 /// @domName Node.hasChildNodes; @docsEditable true | |
| 14566 bool hasChildNodes() native; | |
| 14567 | |
| 14568 /// @domName Node.insertBefore; @docsEditable true | |
| 14569 Node insertBefore(Node newChild, Node refChild) native; | |
| 14570 | |
| 14571 /// @domName Node.removeChild; @docsEditable true | |
| 14572 @JSName('removeChild') | |
| 14573 Node $dom_removeChild(Node oldChild) native; | |
| 14574 | |
| 14575 /// @domName Node.removeEventListener; @docsEditable true | |
| 14576 @JSName('removeEventListener') | |
| 14577 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | |
| 14578 | |
| 14579 /// @domName Node.replaceChild; @docsEditable true | |
| 14580 @JSName('replaceChild') | |
| 14581 Node $dom_replaceChild(Node newChild, Node oldChild) native; | |
| 14582 | |
| 14583 } | |
| 14584 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 14585 // for details. All rights reserved. Use of this source code is governed by a | |
| 14586 // BSD-style license that can be found in the LICENSE file. | |
| 14587 | |
| 14588 | |
| 14589 /// @domName NodeFilter; @docsEditable true | |
| 14590 class NodeFilter native "*NodeFilter" { | |
| 14591 | |
| 14592 static const int FILTER_ACCEPT = 1; | |
| 14593 | |
| 14594 static const int FILTER_REJECT = 2; | |
| 14595 | |
| 14596 static const int FILTER_SKIP = 3; | |
| 14597 | |
| 14598 static const int SHOW_ALL = 0xFFFFFFFF; | |
| 14599 | |
| 14600 static const int SHOW_ATTRIBUTE = 0x00000002; | |
| 14601 | |
| 14602 static const int SHOW_CDATA_SECTION = 0x00000008; | |
| 14603 | |
| 14604 static const int SHOW_COMMENT = 0x00000080; | |
| 14605 | |
| 14606 static const int SHOW_DOCUMENT = 0x00000100; | |
| 14607 | |
| 14608 static const int SHOW_DOCUMENT_FRAGMENT = 0x00000400; | |
| 14609 | |
| 14610 static const int SHOW_DOCUMENT_TYPE = 0x00000200; | |
| 14611 | |
| 14612 static const int SHOW_ELEMENT = 0x00000001; | |
| 14613 | |
| 14614 static const int SHOW_ENTITY = 0x00000020; | |
| 14615 | |
| 14616 static const int SHOW_ENTITY_REFERENCE = 0x00000010; | |
| 14617 | |
| 14618 static const int SHOW_NOTATION = 0x00000800; | |
| 14619 | |
| 14620 static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040; | |
| 14621 | |
| 14622 static const int SHOW_TEXT = 0x00000004; | |
| 14623 | |
| 14624 /// @domName NodeFilter.acceptNode; @docsEditable true | |
| 14625 int acceptNode(Node n) native; | |
| 14626 } | |
| 14627 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 14628 // for details. All rights reserved. Use of this source code is governed by a | |
| 14629 // BSD-style license that can be found in the LICENSE file. | |
| 14630 | |
| 14631 | |
| 14632 /// @domName NodeIterator; @docsEditable true | |
| 14633 class NodeIterator native "*NodeIterator" { | |
| 14634 | |
| 14635 /// @domName NodeIterator.expandEntityReferences; @docsEditable true | |
| 14636 final bool expandEntityReferences; | |
| 14637 | |
| 14638 /// @domName NodeIterator.filter; @docsEditable true | |
| 14639 final NodeFilter filter; | |
| 14640 | |
| 14641 /// @domName NodeIterator.pointerBeforeReferenceNode; @docsEditable true | |
| 14642 final bool pointerBeforeReferenceNode; | |
| 14643 | |
| 14644 /// @domName NodeIterator.referenceNode; @docsEditable true | |
| 14645 final Node referenceNode; | |
| 14646 | |
| 14647 /// @domName NodeIterator.root; @docsEditable true | |
| 14648 final Node root; | |
| 14649 | |
| 14650 /// @domName NodeIterator.whatToShow; @docsEditable true | |
| 14651 final int whatToShow; | |
| 14652 | |
| 14653 /// @domName NodeIterator.detach; @docsEditable true | |
| 14654 void detach() native; | |
| 14655 | |
| 14656 /// @domName NodeIterator.nextNode; @docsEditable true | |
| 14657 Node nextNode() native; | |
| 14658 | |
| 14659 /// @domName NodeIterator.previousNode; @docsEditable true | |
| 14660 Node previousNode() native; | |
| 14661 } | |
| 14662 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 14663 // for details. All rights reserved. Use of this source code is governed by a | |
| 14664 // BSD-style license that can be found in the LICENSE file. | |
| 14665 | |
| 14666 | |
| 14667 /// @domName NodeList; @docsEditable true | |
| 14668 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi
st" { | |
| 14669 | |
| 14670 /// @domName NodeList.length; @docsEditable true | |
| 14671 int get length => JS("int", "#.length", this); | |
| 14672 | |
| 14673 Node operator[](int index) => JS("Node", "#[#]", this, index); | |
| 14674 | |
| 14675 void operator[]=(int index, Node value) { | |
| 14676 throw new UnsupportedError("Cannot assign element of immutable List."); | |
| 14677 } | |
| 14678 // -- start List<Node> mixins. | |
| 14679 // Node is the element type. | |
| 14680 | |
| 14681 // From Iterable<Node>: | |
| 14682 | |
| 14683 Iterator<Node> iterator() { | |
| 14684 // Note: NodeLists are not fixed size. And most probably length shouldn't | |
| 14685 // be cached in both iterator _and_ forEach method. For now caching it | |
| 14686 // for consistency. | |
| 14687 return new FixedSizeListIterator<Node>(this); | |
| 14688 } | |
| 14689 | |
| 14690 // From Collection<Node>: | |
| 14691 | |
| 14692 void add(Node value) { | |
| 14693 throw new UnsupportedError("Cannot add to immutable List."); | |
| 14694 } | |
| 14695 | |
| 14696 void addLast(Node value) { | |
| 14697 throw new UnsupportedError("Cannot add to immutable List."); | |
| 14698 } | |
| 14699 | |
| 14700 void addAll(Collection<Node> collection) { | |
| 14701 throw new UnsupportedError("Cannot add to immutable List."); | |
| 14702 } | |
| 14703 | |
| 14704 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) { | |
| 14705 return Collections.reduce(this, initialValue, combine); | |
| 14706 } | |
| 14707 | |
| 14708 bool contains(Node element) => Collections.contains(this, element); | |
| 14709 | |
| 14710 void forEach(void f(Node element)) => Collections.forEach(this, f); | |
| 14711 | |
| 14712 Collection map(f(Node element)) => Collections.map(this, [], f); | |
| 14713 | |
| 14714 Collection<Node> filter(bool f(Node element)) => | |
| 14715 Collections.filter(this, <Node>[], f); | |
| 14716 | |
| 14717 bool every(bool f(Node element)) => Collections.every(this, f); | |
| 14718 | |
| 14719 bool some(bool f(Node element)) => Collections.some(this, f); | |
| 14720 | |
| 14721 bool get isEmpty => this.length == 0; | |
| 14722 | |
| 14723 // From List<Node>: | |
| 14724 void set length(int value) { | |
| 14725 throw new UnsupportedError("Cannot resize immutable List."); | |
| 14726 } | |
| 14727 | |
| 14728 void clear() { | |
| 14729 throw new UnsupportedError("Cannot clear immutable List."); | |
| 14730 } | |
| 14731 | |
| 14732 void sort([int compare(Node a, Node b)]) { | |
| 14733 throw new UnsupportedError("Cannot sort immutable List."); | |
| 14734 } | |
| 14735 | |
| 14736 int indexOf(Node element, [int start = 0]) => | |
| 14737 Lists.indexOf(this, element, start, this.length); | |
| 14738 | |
| 14739 int lastIndexOf(Node element, [int start]) { | 14078 int lastIndexOf(Node element, [int start]) { |
| 14740 if (start == null) start = length - 1; | 14079 if (start == null) start = length - 1; |
| 14741 return Lists.lastIndexOf(this, element, start); | 14080 return Lists.lastIndexOf(this, element, start); |
| 14742 } | 14081 } |
| 14743 | 14082 |
| 14744 Node get first => this[0]; | 14083 Node get first => this[0]; |
| 14745 | 14084 |
| 14746 Node get last => this[length - 1]; | 14085 Node get last => this[length - 1]; |
| 14747 | 14086 |
| 14748 Node removeAt(int pos) { | 14087 Node removeAt(int pos) { |
| (...skipping 3201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17950 // BSD-style license that can be found in the LICENSE file. | 17289 // BSD-style license that can be found in the LICENSE file. |
| 17951 | 17290 |
| 17952 | 17291 |
| 17953 /// @domName TextEvent; @docsEditable true | 17292 /// @domName TextEvent; @docsEditable true |
| 17954 class TextEvent extends UIEvent native "*TextEvent" { | 17293 class TextEvent extends UIEvent native "*TextEvent" { |
| 17955 | 17294 |
| 17956 /// @domName TextEvent.data; @docsEditable true | 17295 /// @domName TextEvent.data; @docsEditable true |
| 17957 final String data; | 17296 final String data; |
| 17958 | 17297 |
| 17959 /// @domName TextEvent.initTextEvent; @docsEditable true | 17298 /// @domName TextEvent.initTextEvent; @docsEditable true |
| 17960 void initTextEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Loca
lWindow viewArg, String dataArg) native; | 17299 void initTextEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Wind
ow viewArg, String dataArg) native; |
| 17961 } | 17300 } |
| 17962 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 17301 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 17963 // for details. All rights reserved. Use of this source code is governed by a | 17302 // for details. All rights reserved. Use of this source code is governed by a |
| 17964 // BSD-style license that can be found in the LICENSE file. | 17303 // BSD-style license that can be found in the LICENSE file. |
| 17965 | 17304 |
| 17966 | 17305 |
| 17967 /// @domName TextMetrics; @docsEditable true | 17306 /// @domName TextMetrics; @docsEditable true |
| 17968 class TextMetrics native "*TextMetrics" { | 17307 class TextMetrics native "*TextMetrics" { |
| 17969 | 17308 |
| 17970 /// @domName TextMetrics.width; @docsEditable true | 17309 /// @domName TextMetrics.width; @docsEditable true |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18468 /// @domName TouchEvent.shiftKey; @docsEditable true | 17807 /// @domName TouchEvent.shiftKey; @docsEditable true |
| 18469 final bool shiftKey; | 17808 final bool shiftKey; |
| 18470 | 17809 |
| 18471 /// @domName TouchEvent.targetTouches; @docsEditable true | 17810 /// @domName TouchEvent.targetTouches; @docsEditable true |
| 18472 final TouchList targetTouches; | 17811 final TouchList targetTouches; |
| 18473 | 17812 |
| 18474 /// @domName TouchEvent.touches; @docsEditable true | 17813 /// @domName TouchEvent.touches; @docsEditable true |
| 18475 final TouchList touches; | 17814 final TouchList touches; |
| 18476 | 17815 |
| 18477 /// @domName TouchEvent.initTouchEvent; @docsEditable true | 17816 /// @domName TouchEvent.initTouchEvent; @docsEditable true |
| 18478 void initTouchEvent(TouchList touches, TouchList targetTouches, TouchList chan
gedTouches, String type, LocalWindow view, int screenX, int screenY, int clientX
, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native; | 17817 void initTouchEvent(TouchList touches, TouchList targetTouches, TouchList chan
gedTouches, String type, Window view, int screenX, int screenY, int clientX, int
clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native; |
| 18479 } | 17818 } |
| 18480 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 17819 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 18481 // for details. All rights reserved. Use of this source code is governed by a | 17820 // for details. All rights reserved. Use of this source code is governed by a |
| 18482 // BSD-style license that can be found in the LICENSE file. | 17821 // BSD-style license that can be found in the LICENSE file. |
| 18483 | 17822 |
| 18484 | 17823 |
| 18485 /// @domName TouchList; @docsEditable true | 17824 /// @domName TouchList; @docsEditable true |
| 18486 class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
hList" { | 17825 class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
hList" { |
| 18487 | 17826 |
| 18488 /// @domName TouchList.length; @docsEditable true | 17827 /// @domName TouchList.length; @docsEditable true |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18740 /// @domName UIEvent.layerY; @docsEditable true | 18079 /// @domName UIEvent.layerY; @docsEditable true |
| 18741 final int layerY; | 18080 final int layerY; |
| 18742 | 18081 |
| 18743 /// @domName UIEvent.pageX; @docsEditable true | 18082 /// @domName UIEvent.pageX; @docsEditable true |
| 18744 final int pageX; | 18083 final int pageX; |
| 18745 | 18084 |
| 18746 /// @domName UIEvent.pageY; @docsEditable true | 18085 /// @domName UIEvent.pageY; @docsEditable true |
| 18747 final int pageY; | 18086 final int pageY; |
| 18748 | 18087 |
| 18749 /// @domName UIEvent.view; @docsEditable true | 18088 /// @domName UIEvent.view; @docsEditable true |
| 18750 Window get view => _convertNativeToDart_Window(this._view); | 18089 WindowBase get view => _convertNativeToDart_Window(this._view); |
| 18751 @JSName('view') | 18090 @JSName('view') |
| 18752 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 18091 @Creates('Window|=Object') @Returns('Window|=Object') |
| 18753 final dynamic _view; | 18092 final dynamic _view; |
| 18754 | 18093 |
| 18755 /// @domName UIEvent.which; @docsEditable true | 18094 /// @domName UIEvent.which; @docsEditable true |
| 18756 final int which; | 18095 final int which; |
| 18757 | 18096 |
| 18758 /// @domName UIEvent.initUIEvent; @docsEditable true | 18097 /// @domName UIEvent.initUIEvent; @docsEditable true |
| 18759 @JSName('initUIEvent') | 18098 @JSName('initUIEvent') |
| 18760 void $dom_initUIEvent(String type, bool canBubble, bool cancelable, LocalWindo
w view, int detail) native; | 18099 void $dom_initUIEvent(String type, bool canBubble, bool cancelable, Window vie
w, int detail) native; |
| 18761 | 18100 |
| 18762 } | 18101 } |
| 18763 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 18102 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 18764 // for details. All rights reserved. Use of this source code is governed by a | 18103 // for details. All rights reserved. Use of this source code is governed by a |
| 18765 // BSD-style license that can be found in the LICENSE file. | 18104 // BSD-style license that can be found in the LICENSE file. |
| 18766 | 18105 |
| 18767 | 18106 |
| 18768 /// @domName HTMLUListElement; @docsEditable true | 18107 /// @domName HTMLUListElement; @docsEditable true |
| 18769 class UListElement extends Element native "*HTMLUListElement" { | 18108 class UListElement extends Element native "*HTMLUListElement" { |
| 18770 | 18109 |
| (...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20763 // BSD-style license that can be found in the LICENSE file. | 20102 // BSD-style license that can be found in the LICENSE file. |
| 20764 | 20103 |
| 20765 | 20104 |
| 20766 /// @domName WheelEvent | 20105 /// @domName WheelEvent |
| 20767 class WheelEvent extends MouseEvent native "*WheelEvent" { | 20106 class WheelEvent extends MouseEvent native "*WheelEvent" { |
| 20768 | 20107 |
| 20769 /// @domName WheelEvent.webkitDirectionInvertedFromDevice; @docsEditable true | 20108 /// @domName WheelEvent.webkitDirectionInvertedFromDevice; @docsEditable true |
| 20770 final bool webkitDirectionInvertedFromDevice; | 20109 final bool webkitDirectionInvertedFromDevice; |
| 20771 | 20110 |
| 20772 /// @domName WheelEvent.initWebKitWheelEvent; @docsEditable true | 20111 /// @domName WheelEvent.initWebKitWheelEvent; @docsEditable true |
| 20773 void initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, LocalWindow view,
int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, b
ool shiftKey, bool metaKey) native; | 20112 void initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, Window view, int s
creenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool s
hiftKey, bool metaKey) native; |
| 20774 | 20113 |
| 20775 | 20114 |
| 20776 /** @domName WheelEvent.deltaY */ | 20115 /** @domName WheelEvent.deltaY */ |
| 20777 num get deltaY { | 20116 num get deltaY { |
| 20778 if (JS('bool', '#.deltaY !== undefined', this)) { | 20117 if (JS('bool', '#.deltaY !== undefined', this)) { |
| 20779 // W3C WheelEvent | 20118 // W3C WheelEvent |
| 20780 return this._deltaY; | 20119 return this._deltaY; |
| 20781 } else if (JS('bool', '#.wheelDelta !== undefined', this)) { | 20120 } else if (JS('bool', '#.wheelDelta !== undefined', this)) { |
| 20782 // Chrome and IE | 20121 // Chrome and IE |
| 20783 return this._wheelDelta; | 20122 return this._wheelDelta; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20841 num get _deltaY => JS('num', '#.deltaY', this); | 20180 num get _deltaY => JS('num', '#.deltaY', this); |
| 20842 num get _deltaX => JS('num', '#.deltaX', this); | 20181 num get _deltaX => JS('num', '#.deltaX', this); |
| 20843 num get _wheelDelta => JS('num', '#.wheelDelta', this); | 20182 num get _wheelDelta => JS('num', '#.wheelDelta', this); |
| 20844 num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this); | 20183 num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this); |
| 20845 num get _detail => JS('num', '#.detail', this); | 20184 num get _detail => JS('num', '#.detail', this); |
| 20846 int get _deltaMode => JS('int', '#.deltaMode', this); | 20185 int get _deltaMode => JS('int', '#.deltaMode', this); |
| 20847 | 20186 |
| 20848 } | 20187 } |
| 20849 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 20188 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 20850 // for details. All rights reserved. Use of this source code is governed by a | 20189 // for details. All rights reserved. Use of this source code is governed by a |
| 20190 // BSD-style license that can be found in the LICENSE file. |
| 20191 |
| 20192 |
| 20193 /// @domName Window |
| 20194 class Window extends EventTarget implements WindowBase native "@*DOMWindow" { |
| 20195 |
| 20196 Document get document => JS('Document', '#.document', this); |
| 20197 |
| 20198 WindowBase _open2(url, name) => JS('Window', '#.open(#,#)', this, url, name); |
| 20199 |
| 20200 WindowBase _open3(url, name, options) => |
| 20201 JS('Window', '#.open(#,#,#)', this, url, name, options); |
| 20202 |
| 20203 WindowBase open(String url, String name, [String options]) { |
| 20204 if (options == null) { |
| 20205 return _DOMWindowCrossFrame._createSafe(_open2(url, name)); |
| 20206 } else { |
| 20207 return _DOMWindowCrossFrame._createSafe(_open3(url, name, options)); |
| 20208 } |
| 20209 } |
| 20210 |
| 20211 // API level getter and setter for Location. |
| 20212 // TODO: The cross domain safe wrapper can be inserted here or folded into |
| 20213 // _LocationWrapper. |
| 20214 Location get location { |
| 20215 // Firefox work-around for Location. The Firefox location object cannot be |
| 20216 // made to behave like a Dart object so must be wrapped. |
| 20217 var result = _location; |
| 20218 if (_isDartLocation(result)) return result; // e.g. on Chrome. |
| 20219 if (null == _location_wrapper) { |
| 20220 _location_wrapper = new _LocationWrapper(result); |
| 20221 } |
| 20222 return _location_wrapper; |
| 20223 } |
| 20224 |
| 20225 // TODO: consider forcing users to do: window.location.assign('string'). |
| 20226 /** |
| 20227 * Sets the window's location, which causes the browser to navigate to the new |
| 20228 * location. [value] may be a Location object or a string. |
| 20229 */ |
| 20230 void set location(value) { |
| 20231 if (value is _LocationWrapper) { |
| 20232 _location = value._ptr; |
| 20233 } else { |
| 20234 _location = value; |
| 20235 } |
| 20236 } |
| 20237 |
| 20238 _LocationWrapper _location_wrapper; // Cached wrapped Location object. |
| 20239 |
| 20240 // Native getter and setter to access raw Location object. |
| 20241 dynamic get _location => JS('Location|=Object', '#.location', this); |
| 20242 void set _location(value) { |
| 20243 JS('void', '#.location = #', this, value); |
| 20244 } |
| 20245 // Prevent compiled from thinking 'location' property is available for a Dart |
| 20246 // member. |
| 20247 @JSName('location') |
| 20248 _protect_location() native; |
| 20249 |
| 20250 static _isDartLocation(thing) { |
| 20251 // On Firefox the code that implements 'is Location' fails to find the patch |
| 20252 // stub on Object.prototype and throws an exception. |
| 20253 try { |
| 20254 return thing is Location; |
| 20255 } catch (e) { |
| 20256 return false; |
| 20257 } |
| 20258 } |
| 20259 |
| 20260 /** |
| 20261 * Executes a [callback] after the next batch of browser layout measurements |
| 20262 * has completed or would have completed if any browser layout measurements |
| 20263 * had been scheduled. |
| 20264 */ |
| 20265 void requestLayoutFrame(TimeoutHandler callback) { |
| 20266 _addMeasurementFrameCallback(callback); |
| 20267 } |
| 20268 |
| 20269 /** @domName DOMWindow.requestAnimationFrame */ |
| 20270 int requestAnimationFrame(RequestAnimationFrameCallback callback) { |
| 20271 _ensureRequestAnimationFrame(); |
| 20272 return _requestAnimationFrame(callback); |
| 20273 } |
| 20274 |
| 20275 void cancelAnimationFrame(id) { |
| 20276 _ensureRequestAnimationFrame(); |
| 20277 _cancelAnimationFrame(id); |
| 20278 } |
| 20279 |
| 20280 @JSName('requestAnimationFrame') |
| 20281 int _requestAnimationFrame(RequestAnimationFrameCallback callback) native; |
| 20282 |
| 20283 @JSName('cancelAnimationFrame') |
| 20284 void _cancelAnimationFrame(int id) native; |
| 20285 |
| 20286 _ensureRequestAnimationFrame() { |
| 20287 if (JS('bool', |
| 20288 '!!(#.requestAnimationFrame && #.cancelAnimationFrame)', this, this)) |
| 20289 return; |
| 20290 |
| 20291 JS('void', |
| 20292 r""" |
| 20293 (function($this) { |
| 20294 var vendors = ['ms', 'moz', 'webkit', 'o']; |
| 20295 for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) { |
| 20296 $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame']; |
| 20297 $this.cancelAnimationFrame = |
| 20298 $this[vendors[i]+'CancelAnimationFrame'] || |
| 20299 $this[vendors[i]+'CancelRequestAnimationFrame']; |
| 20300 } |
| 20301 if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return; |
| 20302 $this.requestAnimationFrame = function(callback) { |
| 20303 return window.setTimeout(function() { |
| 20304 callback(Date.now()); |
| 20305 }, 16 /* 16ms ~= 60fps */); |
| 20306 }; |
| 20307 $this.cancelAnimationFrame = function(id) { clearTimeout(id); } |
| 20308 })(#)""", |
| 20309 this); |
| 20310 } |
| 20311 |
| 20312 IdbFactory get indexedDB => |
| 20313 JS('IdbFactory', |
| 20314 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', |
| 20315 this, this, this); |
| 20316 |
| 20317 /** |
| 20318 * Lookup a port by its [name]. Return null if no port is |
| 20319 * registered under [name]. |
| 20320 */ |
| 20321 SendPortSync lookupPort(String name) { |
| 20322 var port = JSON.parse(document.documentElement.attributes['dart-port:$name']
); |
| 20323 return _deserialize(port); |
| 20324 } |
| 20325 |
| 20326 /** |
| 20327 * Register a [port] on this window under the given [name]. This |
| 20328 * port may be retrieved by any isolate (or JavaScript script) |
| 20329 * running in this window. |
| 20330 */ |
| 20331 void registerPort(String name, var port) { |
| 20332 var serialized = _serialize(port); |
| 20333 document.documentElement.attributes['dart-port:$name'] = JSON.stringify(seri
alized); |
| 20334 } |
| 20335 |
| 20336 /// @domName Window.console; @docsEditable true |
| 20337 Console get console => Console.safeConsole; |
| 20338 |
| 20339 |
| 20340 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 20341 WindowEvents get on => |
| 20342 new WindowEvents(this); |
| 20343 |
| 20344 static const int PERSISTENT = 1; |
| 20345 |
| 20346 static const int TEMPORARY = 0; |
| 20347 |
| 20348 /// @domName Window.applicationCache; @docsEditable true |
| 20349 final ApplicationCache applicationCache; |
| 20350 |
| 20351 /// @domName Window.closed; @docsEditable true |
| 20352 final bool closed; |
| 20353 |
| 20354 /// @domName Window.crypto; @docsEditable true |
| 20355 final Crypto crypto; |
| 20356 |
| 20357 /// @domName Window.defaultStatus; @docsEditable true |
| 20358 String defaultStatus; |
| 20359 |
| 20360 /// @domName Window.defaultstatus; @docsEditable true |
| 20361 String defaultstatus; |
| 20362 |
| 20363 /// @domName Window.devicePixelRatio; @docsEditable true |
| 20364 final num devicePixelRatio; |
| 20365 |
| 20366 /// @domName Window.event; @docsEditable true |
| 20367 final Event event; |
| 20368 |
| 20369 /// @domName Window.history; @docsEditable true |
| 20370 final History history; |
| 20371 |
| 20372 /// @domName Window.innerHeight; @docsEditable true |
| 20373 final int innerHeight; |
| 20374 |
| 20375 /// @domName Window.innerWidth; @docsEditable true |
| 20376 final int innerWidth; |
| 20377 |
| 20378 /// @domName Window.localStorage; @docsEditable true |
| 20379 final Storage localStorage; |
| 20380 |
| 20381 /// @domName Window.locationbar; @docsEditable true |
| 20382 final BarInfo locationbar; |
| 20383 |
| 20384 /// @domName Window.menubar; @docsEditable true |
| 20385 final BarInfo menubar; |
| 20386 |
| 20387 /// @domName Window.name; @docsEditable true |
| 20388 String name; |
| 20389 |
| 20390 /// @domName Window.navigator; @docsEditable true |
| 20391 final Navigator navigator; |
| 20392 |
| 20393 /// @domName Window.offscreenBuffering; @docsEditable true |
| 20394 final bool offscreenBuffering; |
| 20395 |
| 20396 /// @domName Window.opener; @docsEditable true |
| 20397 WindowBase get opener => _convertNativeToDart_Window(this._opener); |
| 20398 @JSName('opener') |
| 20399 @Creates('Window|=Object') @Returns('Window|=Object') |
| 20400 final dynamic _opener; |
| 20401 |
| 20402 /// @domName Window.outerHeight; @docsEditable true |
| 20403 final int outerHeight; |
| 20404 |
| 20405 /// @domName Window.outerWidth; @docsEditable true |
| 20406 final int outerWidth; |
| 20407 |
| 20408 /// @domName DOMWindow.pagePopupController; @docsEditable true |
| 20409 final PagePopupController pagePopupController; |
| 20410 |
| 20411 /// @domName Window.pageXOffset; @docsEditable true |
| 20412 final int pageXOffset; |
| 20413 |
| 20414 /// @domName Window.pageYOffset; @docsEditable true |
| 20415 final int pageYOffset; |
| 20416 |
| 20417 /// @domName Window.parent; @docsEditable true |
| 20418 WindowBase get parent => _convertNativeToDart_Window(this._parent); |
| 20419 @JSName('parent') |
| 20420 @Creates('Window|=Object') @Returns('Window|=Object') |
| 20421 final dynamic _parent; |
| 20422 |
| 20423 /// @domName Window.performance; @docsEditable true |
| 20424 final Performance performance; |
| 20425 |
| 20426 /// @domName Window.personalbar; @docsEditable true |
| 20427 final BarInfo personalbar; |
| 20428 |
| 20429 /// @domName Window.screen; @docsEditable true |
| 20430 final Screen screen; |
| 20431 |
| 20432 /// @domName Window.screenLeft; @docsEditable true |
| 20433 final int screenLeft; |
| 20434 |
| 20435 /// @domName Window.screenTop; @docsEditable true |
| 20436 final int screenTop; |
| 20437 |
| 20438 /// @domName Window.screenX; @docsEditable true |
| 20439 final int screenX; |
| 20440 |
| 20441 /// @domName Window.screenY; @docsEditable true |
| 20442 final int screenY; |
| 20443 |
| 20444 /// @domName Window.scrollX; @docsEditable true |
| 20445 final int scrollX; |
| 20446 |
| 20447 /// @domName Window.scrollY; @docsEditable true |
| 20448 final int scrollY; |
| 20449 |
| 20450 /// @domName Window.scrollbars; @docsEditable true |
| 20451 final BarInfo scrollbars; |
| 20452 |
| 20453 /// @domName Window.self; @docsEditable true |
| 20454 WindowBase get self => _convertNativeToDart_Window(this._self); |
| 20455 @JSName('self') |
| 20456 @Creates('Window|=Object') @Returns('Window|=Object') |
| 20457 final dynamic _self; |
| 20458 |
| 20459 /// @domName Window.sessionStorage; @docsEditable true |
| 20460 final Storage sessionStorage; |
| 20461 |
| 20462 /// @domName Window.status; @docsEditable true |
| 20463 String status; |
| 20464 |
| 20465 /// @domName Window.statusbar; @docsEditable true |
| 20466 final BarInfo statusbar; |
| 20467 |
| 20468 /// @domName Window.styleMedia; @docsEditable true |
| 20469 final StyleMedia styleMedia; |
| 20470 |
| 20471 /// @domName Window.toolbar; @docsEditable true |
| 20472 final BarInfo toolbar; |
| 20473 |
| 20474 /// @domName Window.top; @docsEditable true |
| 20475 WindowBase get top => _convertNativeToDart_Window(this._top); |
| 20476 @JSName('top') |
| 20477 @Creates('Window|=Object') @Returns('Window|=Object') |
| 20478 final dynamic _top; |
| 20479 |
| 20480 /// @domName DOMWindow.webkitNotifications; @docsEditable true |
| 20481 final NotificationCenter webkitNotifications; |
| 20482 |
| 20483 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true |
| 20484 final StorageInfo webkitStorageInfo; |
| 20485 |
| 20486 /// @domName Window.window; @docsEditable true |
| 20487 WindowBase get window => _convertNativeToDart_Window(this._window); |
| 20488 @JSName('window') |
| 20489 @Creates('Window|=Object') @Returns('Window|=Object') |
| 20490 final dynamic _window; |
| 20491 |
| 20492 /// @domName Window.addEventListener; @docsEditable true |
| 20493 @JSName('addEventListener') |
| 20494 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 20495 |
| 20496 /// @domName Window.alert; @docsEditable true |
| 20497 void alert(String message) native; |
| 20498 |
| 20499 /// @domName Window.atob; @docsEditable true |
| 20500 String atob(String string) native; |
| 20501 |
| 20502 /// @domName Window.btoa; @docsEditable true |
| 20503 String btoa(String string) native; |
| 20504 |
| 20505 /// @domName Window.captureEvents; @docsEditable true |
| 20506 void captureEvents() native; |
| 20507 |
| 20508 /// @domName Window.clearInterval; @docsEditable true |
| 20509 void clearInterval(int handle) native; |
| 20510 |
| 20511 /// @domName Window.clearTimeout; @docsEditable true |
| 20512 void clearTimeout(int handle) native; |
| 20513 |
| 20514 /// @domName Window.close; @docsEditable true |
| 20515 void close() native; |
| 20516 |
| 20517 /// @domName Window.confirm; @docsEditable true |
| 20518 bool confirm(String message) native; |
| 20519 |
| 20520 /// @domName Window.dispatchEvent; @docsEditable true |
| 20521 @JSName('dispatchEvent') |
| 20522 bool $dom_dispatchEvent(Event evt) native; |
| 20523 |
| 20524 /// @domName Window.find; @docsEditable true |
| 20525 bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool w
holeWord, bool searchInFrames, bool showDialog) native; |
| 20526 |
| 20527 /// @domName Window.getComputedStyle; @docsEditable true |
| 20528 @JSName('getComputedStyle') |
| 20529 CssStyleDeclaration $dom_getComputedStyle(Element element, String pseudoElemen
t) native; |
| 20530 |
| 20531 /// @domName Window.getMatchedCSSRules; @docsEditable true |
| 20532 @JSName('getMatchedCSSRules') |
| 20533 @Returns('_CssRuleList') @Creates('_CssRuleList') |
| 20534 List<CssRule> getMatchedCssRules(Element element, String pseudoElement) native
; |
| 20535 |
| 20536 /// @domName Window.getSelection; @docsEditable true |
| 20537 DomSelection getSelection() native; |
| 20538 |
| 20539 /// @domName Window.matchMedia; @docsEditable true |
| 20540 MediaQueryList matchMedia(String query) native; |
| 20541 |
| 20542 /// @domName Window.moveBy; @docsEditable true |
| 20543 void moveBy(num x, num y) native; |
| 20544 |
| 20545 /// @domName Window.moveTo; @docsEditable true |
| 20546 void moveTo(num x, num y) native; |
| 20547 |
| 20548 /// @domName DOMWindow.openDatabase; @docsEditable true |
| 20549 @Creates('Database') @Creates('DatabaseSync') |
| 20550 Database openDatabase(String name, String version, String displayName, int est
imatedSize, [DatabaseCallback creationCallback]) native; |
| 20551 |
| 20552 /// @domName Window.postMessage; @docsEditable true |
| 20553 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List
messagePorts]) { |
| 20554 if (?message && |
| 20555 !?messagePorts) { |
| 20556 var message_1 = convertDartToNative_SerializedScriptValue(message); |
| 20557 _postMessage_1(message_1, targetOrigin); |
| 20558 return; |
| 20559 } |
| 20560 if (?message) { |
| 20561 var message_2 = convertDartToNative_SerializedScriptValue(message); |
| 20562 _postMessage_2(message_2, targetOrigin, messagePorts); |
| 20563 return; |
| 20564 } |
| 20565 throw new ArgumentError("Incorrect number or type of arguments"); |
| 20566 } |
| 20567 @JSName('postMessage') |
| 20568 void _postMessage_1(message, targetOrigin) native; |
| 20569 @JSName('postMessage') |
| 20570 void _postMessage_2(message, targetOrigin, List messagePorts) native; |
| 20571 |
| 20572 /// @domName Window.print; @docsEditable true |
| 20573 void print() native; |
| 20574 |
| 20575 /// @domName Window.releaseEvents; @docsEditable true |
| 20576 void releaseEvents() native; |
| 20577 |
| 20578 /// @domName Window.removeEventListener; @docsEditable true |
| 20579 @JSName('removeEventListener') |
| 20580 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 20581 |
| 20582 /// @domName Window.resizeBy; @docsEditable true |
| 20583 void resizeBy(num x, num y) native; |
| 20584 |
| 20585 /// @domName Window.resizeTo; @docsEditable true |
| 20586 void resizeTo(num width, num height) native; |
| 20587 |
| 20588 /// @domName Window.scroll; @docsEditable true |
| 20589 void scroll(int x, int y) native; |
| 20590 |
| 20591 /// @domName Window.scrollBy; @docsEditable true |
| 20592 void scrollBy(int x, int y) native; |
| 20593 |
| 20594 /// @domName Window.scrollTo; @docsEditable true |
| 20595 void scrollTo(int x, int y) native; |
| 20596 |
| 20597 /// @domName Window.setInterval; @docsEditable true |
| 20598 int setInterval(TimeoutHandler handler, int timeout) native; |
| 20599 |
| 20600 /// @domName Window.setTimeout; @docsEditable true |
| 20601 int setTimeout(TimeoutHandler handler, int timeout) native; |
| 20602 |
| 20603 /// @domName Window.showModalDialog; @docsEditable true |
| 20604 Object showModalDialog(String url, [Object dialogArgs, String featureArgs]) na
tive; |
| 20605 |
| 20606 /// @domName Window.stop; @docsEditable true |
| 20607 void stop() native; |
| 20608 |
| 20609 /// @domName Window.webkitConvertPointFromNodeToPage; @docsEditable true |
| 20610 Point webkitConvertPointFromNodeToPage(Node node, Point p) native; |
| 20611 |
| 20612 /// @domName Window.webkitConvertPointFromPageToNode; @docsEditable true |
| 20613 Point webkitConvertPointFromPageToNode(Node node, Point p) native; |
| 20614 |
| 20615 /// @domName DOMWindow.webkitRequestFileSystem; @docsEditable true |
| 20616 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal
lback, [ErrorCallback errorCallback]) native; |
| 20617 |
| 20618 /// @domName DOMWindow.webkitResolveLocalFileSystemURL; @docsEditable true |
| 20619 @JSName('webkitResolveLocalFileSystemURL') |
| 20620 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback
, [ErrorCallback errorCallback]) native; |
| 20621 |
| 20622 } |
| 20623 |
| 20624 /// @docsEditable true |
| 20625 class WindowEvents extends Events { |
| 20626 /// @docsEditable true |
| 20627 WindowEvents(EventTarget _ptr) : super(_ptr); |
| 20628 |
| 20629 /// @docsEditable true |
| 20630 EventListenerList get contentLoaded => this['DOMContentLoaded']; |
| 20631 |
| 20632 /// @docsEditable true |
| 20633 EventListenerList get abort => this['abort']; |
| 20634 |
| 20635 /// @docsEditable true |
| 20636 EventListenerList get beforeUnload => this['beforeunload']; |
| 20637 |
| 20638 /// @docsEditable true |
| 20639 EventListenerList get blur => this['blur']; |
| 20640 |
| 20641 /// @docsEditable true |
| 20642 EventListenerList get canPlay => this['canplay']; |
| 20643 |
| 20644 /// @docsEditable true |
| 20645 EventListenerList get canPlayThrough => this['canplaythrough']; |
| 20646 |
| 20647 /// @docsEditable true |
| 20648 EventListenerList get change => this['change']; |
| 20649 |
| 20650 /// @docsEditable true |
| 20651 EventListenerList get click => this['click']; |
| 20652 |
| 20653 /// @docsEditable true |
| 20654 EventListenerList get contextMenu => this['contextmenu']; |
| 20655 |
| 20656 /// @docsEditable true |
| 20657 EventListenerList get doubleClick => this['dblclick']; |
| 20658 |
| 20659 /// @docsEditable true |
| 20660 EventListenerList get deviceMotion => this['devicemotion']; |
| 20661 |
| 20662 /// @docsEditable true |
| 20663 EventListenerList get deviceOrientation => this['deviceorientation']; |
| 20664 |
| 20665 /// @docsEditable true |
| 20666 EventListenerList get drag => this['drag']; |
| 20667 |
| 20668 /// @docsEditable true |
| 20669 EventListenerList get dragEnd => this['dragend']; |
| 20670 |
| 20671 /// @docsEditable true |
| 20672 EventListenerList get dragEnter => this['dragenter']; |
| 20673 |
| 20674 /// @docsEditable true |
| 20675 EventListenerList get dragLeave => this['dragleave']; |
| 20676 |
| 20677 /// @docsEditable true |
| 20678 EventListenerList get dragOver => this['dragover']; |
| 20679 |
| 20680 /// @docsEditable true |
| 20681 EventListenerList get dragStart => this['dragstart']; |
| 20682 |
| 20683 /// @docsEditable true |
| 20684 EventListenerList get drop => this['drop']; |
| 20685 |
| 20686 /// @docsEditable true |
| 20687 EventListenerList get durationChange => this['durationchange']; |
| 20688 |
| 20689 /// @docsEditable true |
| 20690 EventListenerList get emptied => this['emptied']; |
| 20691 |
| 20692 /// @docsEditable true |
| 20693 EventListenerList get ended => this['ended']; |
| 20694 |
| 20695 /// @docsEditable true |
| 20696 EventListenerList get error => this['error']; |
| 20697 |
| 20698 /// @docsEditable true |
| 20699 EventListenerList get focus => this['focus']; |
| 20700 |
| 20701 /// @docsEditable true |
| 20702 EventListenerList get hashChange => this['hashchange']; |
| 20703 |
| 20704 /// @docsEditable true |
| 20705 EventListenerList get input => this['input']; |
| 20706 |
| 20707 /// @docsEditable true |
| 20708 EventListenerList get invalid => this['invalid']; |
| 20709 |
| 20710 /// @docsEditable true |
| 20711 EventListenerList get keyDown => this['keydown']; |
| 20712 |
| 20713 /// @docsEditable true |
| 20714 EventListenerList get keyPress => this['keypress']; |
| 20715 |
| 20716 /// @docsEditable true |
| 20717 EventListenerList get keyUp => this['keyup']; |
| 20718 |
| 20719 /// @docsEditable true |
| 20720 EventListenerList get load => this['load']; |
| 20721 |
| 20722 /// @docsEditable true |
| 20723 EventListenerList get loadedData => this['loadeddata']; |
| 20724 |
| 20725 /// @docsEditable true |
| 20726 EventListenerList get loadedMetadata => this['loadedmetadata']; |
| 20727 |
| 20728 /// @docsEditable true |
| 20729 EventListenerList get loadStart => this['loadstart']; |
| 20730 |
| 20731 /// @docsEditable true |
| 20732 EventListenerList get message => this['message']; |
| 20733 |
| 20734 /// @docsEditable true |
| 20735 EventListenerList get mouseDown => this['mousedown']; |
| 20736 |
| 20737 /// @docsEditable true |
| 20738 EventListenerList get mouseMove => this['mousemove']; |
| 20739 |
| 20740 /// @docsEditable true |
| 20741 EventListenerList get mouseOut => this['mouseout']; |
| 20742 |
| 20743 /// @docsEditable true |
| 20744 EventListenerList get mouseOver => this['mouseover']; |
| 20745 |
| 20746 /// @docsEditable true |
| 20747 EventListenerList get mouseUp => this['mouseup']; |
| 20748 |
| 20749 /// @docsEditable true |
| 20750 EventListenerList get mouseWheel => this['mousewheel']; |
| 20751 |
| 20752 /// @docsEditable true |
| 20753 EventListenerList get offline => this['offline']; |
| 20754 |
| 20755 /// @docsEditable true |
| 20756 EventListenerList get online => this['online']; |
| 20757 |
| 20758 /// @docsEditable true |
| 20759 EventListenerList get pageHide => this['pagehide']; |
| 20760 |
| 20761 /// @docsEditable true |
| 20762 EventListenerList get pageShow => this['pageshow']; |
| 20763 |
| 20764 /// @docsEditable true |
| 20765 EventListenerList get pause => this['pause']; |
| 20766 |
| 20767 /// @docsEditable true |
| 20768 EventListenerList get play => this['play']; |
| 20769 |
| 20770 /// @docsEditable true |
| 20771 EventListenerList get playing => this['playing']; |
| 20772 |
| 20773 /// @docsEditable true |
| 20774 EventListenerList get popState => this['popstate']; |
| 20775 |
| 20776 /// @docsEditable true |
| 20777 EventListenerList get progress => this['progress']; |
| 20778 |
| 20779 /// @docsEditable true |
| 20780 EventListenerList get rateChange => this['ratechange']; |
| 20781 |
| 20782 /// @docsEditable true |
| 20783 EventListenerList get reset => this['reset']; |
| 20784 |
| 20785 /// @docsEditable true |
| 20786 EventListenerList get resize => this['resize']; |
| 20787 |
| 20788 /// @docsEditable true |
| 20789 EventListenerList get scroll => this['scroll']; |
| 20790 |
| 20791 /// @docsEditable true |
| 20792 EventListenerList get search => this['search']; |
| 20793 |
| 20794 /// @docsEditable true |
| 20795 EventListenerList get seeked => this['seeked']; |
| 20796 |
| 20797 /// @docsEditable true |
| 20798 EventListenerList get seeking => this['seeking']; |
| 20799 |
| 20800 /// @docsEditable true |
| 20801 EventListenerList get select => this['select']; |
| 20802 |
| 20803 /// @docsEditable true |
| 20804 EventListenerList get stalled => this['stalled']; |
| 20805 |
| 20806 /// @docsEditable true |
| 20807 EventListenerList get storage => this['storage']; |
| 20808 |
| 20809 /// @docsEditable true |
| 20810 EventListenerList get submit => this['submit']; |
| 20811 |
| 20812 /// @docsEditable true |
| 20813 EventListenerList get suspend => this['suspend']; |
| 20814 |
| 20815 /// @docsEditable true |
| 20816 EventListenerList get timeUpdate => this['timeupdate']; |
| 20817 |
| 20818 /// @docsEditable true |
| 20819 EventListenerList get touchCancel => this['touchcancel']; |
| 20820 |
| 20821 /// @docsEditable true |
| 20822 EventListenerList get touchEnd => this['touchend']; |
| 20823 |
| 20824 /// @docsEditable true |
| 20825 EventListenerList get touchMove => this['touchmove']; |
| 20826 |
| 20827 /// @docsEditable true |
| 20828 EventListenerList get touchStart => this['touchstart']; |
| 20829 |
| 20830 /// @docsEditable true |
| 20831 EventListenerList get unload => this['unload']; |
| 20832 |
| 20833 /// @docsEditable true |
| 20834 EventListenerList get volumeChange => this['volumechange']; |
| 20835 |
| 20836 /// @docsEditable true |
| 20837 EventListenerList get waiting => this['waiting']; |
| 20838 |
| 20839 /// @docsEditable true |
| 20840 EventListenerList get animationEnd => this['webkitAnimationEnd']; |
| 20841 |
| 20842 /// @docsEditable true |
| 20843 EventListenerList get animationIteration => this['webkitAnimationIteration']; |
| 20844 |
| 20845 /// @docsEditable true |
| 20846 EventListenerList get animationStart => this['webkitAnimationStart']; |
| 20847 |
| 20848 /// @docsEditable true |
| 20849 EventListenerList get transitionEnd => this['webkitTransitionEnd']; |
| 20850 } |
| 20851 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 20852 // for details. All rights reserved. Use of this source code is governed by a |
| 20851 // BSD-style license that can be found in the LICENSE file. | 20853 // BSD-style license that can be found in the LICENSE file. |
| 20852 | 20854 |
| 20853 | 20855 |
| 20854 /// @domName Worker; @docsEditable true | 20856 /// @domName Worker; @docsEditable true |
| 20855 class Worker extends AbstractWorker native "*Worker" { | 20857 class Worker extends AbstractWorker native "*Worker" { |
| 20856 | 20858 |
| 20857 ///@docsEditable true | 20859 ///@docsEditable true |
| 20858 factory Worker(String scriptUrl) => _WorkerFactoryProvider.createWorker(script
Url); | 20860 factory Worker(String scriptUrl) => _WorkerFactoryProvider.createWorker(script
Url); |
| 20859 | 20861 |
| 20860 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | 20862 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| (...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23086 | 23088 |
| 23087 | 23089 |
| 23088 /** | 23090 /** |
| 23089 * An object representing the top-level context object for web scripting. | 23091 * An object representing the top-level context object for web scripting. |
| 23090 * | 23092 * |
| 23091 * In a web browser, a [Window] object represents the actual browser window. | 23093 * In a web browser, a [Window] object represents the actual browser window. |
| 23092 * In a multi-tabbed browser, each tab has its own [Window] object. A [Window] | 23094 * In a multi-tabbed browser, each tab has its own [Window] object. A [Window] |
| 23093 * is the container that displays a [Document]'s content. All web scripting | 23095 * is the container that displays a [Document]'s content. All web scripting |
| 23094 * happens within the context of a [Window] object. | 23096 * happens within the context of a [Window] object. |
| 23095 * | 23097 * |
| 23096 * **Note:** This class represents any window, whereas [LocalWindow] is | 23098 * **Note:** This class represents any window, whereas [Window] is |
| 23097 * used to access the properties and content of the current window. | 23099 * used to access the properties and content of the current window. |
| 23098 * | 23100 * |
| 23099 * See also: | 23101 * See also: |
| 23100 * | 23102 * |
| 23101 * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN. | 23103 * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN. |
| 23102 * * [Window](http://www.w3.org/TR/Window/) from the W3C. | 23104 * * [Window](http://www.w3.org/TR/Window/) from the W3C. |
| 23103 */ | 23105 */ |
| 23104 abstract class Window { | 23106 abstract class WindowBase { |
| 23105 // Fields. | 23107 // Fields. |
| 23106 | 23108 |
| 23107 /** | 23109 /** |
| 23108 * The current location of this window. | 23110 * The current location of this window. |
| 23109 * | 23111 * |
| 23110 * Location currentLocation = window.location; | 23112 * Location currentLocation = window.location; |
| 23111 * print(currentLocation.href); // 'http://www.example.com:80/' | 23113 * print(currentLocation.href); // 'http://www.example.com:80/' |
| 23112 */ | 23114 */ |
| 23113 Location get location; | 23115 LocationBase get location; |
| 23114 History get history; | 23116 HistoryBase get history; |
| 23115 | 23117 |
| 23116 /** | 23118 /** |
| 23117 * Indicates whether this window has been closed. | 23119 * Indicates whether this window has been closed. |
| 23118 * | 23120 * |
| 23119 * print(window.closed); // 'false' | 23121 * print(window.closed); // 'false' |
| 23120 * window.close(); | 23122 * window.close(); |
| 23121 * print(window.closed); // 'true' | 23123 * print(window.closed); // 'true' |
| 23122 */ | 23124 */ |
| 23123 bool get closed; | 23125 bool get closed; |
| 23124 | 23126 |
| 23125 /** | 23127 /** |
| 23126 * A reference to the window that opened this one. | 23128 * A reference to the window that opened this one. |
| 23127 * | 23129 * |
| 23128 * Window thisWindow = window; | 23130 * Window thisWindow = window; |
| 23129 * Window otherWindow = thisWindow.open('http://www.example.com/', 'foo'); | 23131 * WindowBase otherWindow = thisWindow.open('http://www.example.com/', 'fo
o'); |
| 23130 * print(otherWindow.opener == thisWindow); // 'true' | 23132 * print(otherWindow.opener == thisWindow); // 'true' |
| 23131 */ | 23133 */ |
| 23132 Window get opener; | 23134 WindowBase get opener; |
| 23133 | 23135 |
| 23134 /** | 23136 /** |
| 23135 * A reference to the parent of this window. | 23137 * A reference to the parent of this window. |
| 23136 * | 23138 * |
| 23137 * If this [Window] has no parent, [parent] will return a reference to | 23139 * If this [WindowBase] has no parent, [parent] will return a reference to |
| 23138 * the [Window] itself. | 23140 * the [WindowBase] itself. |
| 23139 * | 23141 * |
| 23140 * IFrameElement myIFrame = new IFrameElement(); | 23142 * IFrameElement myIFrame = new IFrameElement(); |
| 23141 * window.document.body.elements.add(myIFrame); | 23143 * window.document.body.elements.add(myIFrame); |
| 23142 * print(myIframe.contentWindow.parent == window) // 'true' | 23144 * print(myIframe.contentWindow.parent == window) // 'true' |
| 23143 * | 23145 * |
| 23144 * print(window.parent == window) // 'true' | 23146 * print(window.parent == window) // 'true' |
| 23145 */ | 23147 */ |
| 23146 Window get parent; | 23148 WindowBase get parent; |
| 23147 | 23149 |
| 23148 /** | 23150 /** |
| 23149 * A reference to the topmost window in the window hierarchy. | 23151 * A reference to the topmost window in the window hierarchy. |
| 23150 * | 23152 * |
| 23151 * If this [Window] is the topmost [Window], [top] will return a reference to | 23153 * If this [WindowBase] is the topmost [WindowBase], [top] will return a |
| 23152 * the [Window] itself. | 23154 * reference to the [WindowBase] itself. |
| 23153 * | 23155 * |
| 23154 * // Add an IFrame to the current window. | 23156 * // Add an IFrame to the current window. |
| 23155 * IFrameElement myIFrame = new IFrameElement(); | 23157 * IFrameElement myIFrame = new IFrameElement(); |
| 23156 * window.document.body.elements.add(myIFrame); | 23158 * window.document.body.elements.add(myIFrame); |
| 23157 * | 23159 * |
| 23158 * // Add an IFrame inside of the other IFrame. | 23160 * // Add an IFrame inside of the other IFrame. |
| 23159 * IFrameElement innerIFrame = new IFrameElement(); | 23161 * IFrameElement innerIFrame = new IFrameElement(); |
| 23160 * myIFrame.elements.add(innerIFrame); | 23162 * myIFrame.elements.add(innerIFrame); |
| 23161 * | 23163 * |
| 23162 * print(myIframe.contentWindow.top == window) // 'true' | 23164 * print(myIframe.contentWindow.top == window) // 'true' |
| 23163 * print(innerIFrame.contentWindow.top == window) // 'true' | 23165 * print(innerIFrame.contentWindow.top == window) // 'true' |
| 23164 * | 23166 * |
| 23165 * print(window.top == window) // 'true' | 23167 * print(window.top == window) // 'true' |
| 23166 */ | 23168 */ |
| 23167 Window get top; | 23169 WindowBase get top; |
| 23168 | 23170 |
| 23169 // Methods. | 23171 // Methods. |
| 23170 /** | 23172 /** |
| 23171 * Closes the window. | 23173 * Closes the window. |
| 23172 * | 23174 * |
| 23173 * This method should only succeed if the [Window] object is | 23175 * This method should only succeed if the [WindowBase] object is |
| 23174 * **script-closeable** and the window calling [close] is allowed to navigate | 23176 * **script-closeable** and the window calling [close] is allowed to navigate |
| 23175 * the window. | 23177 * the window. |
| 23176 * | 23178 * |
| 23177 * A window is script-closeable if it is either a window | 23179 * A window is script-closeable if it is either a window |
| 23178 * that was opened by another window, or if it is a window with only one | 23180 * that was opened by another window, or if it is a window with only one |
| 23179 * document in its history. | 23181 * document in its history. |
| 23180 * | 23182 * |
| 23181 * A window might not be allowed to navigate, and therefore close, another | 23183 * A window might not be allowed to navigate, and therefore close, another |
| 23182 * window due to browser security features. | 23184 * window due to browser security features. |
| 23183 * | 23185 * |
| 23184 * var other = window.open('http://www.example.com', 'foo'); | 23186 * var other = window.open('http://www.example.com', 'foo'); |
| 23185 * // Closes other window, as it is script-closeable. | 23187 * // Closes other window, as it is script-closeable. |
| 23186 * other.close(); | 23188 * other.close(); |
| 23187 * print(other.closed()); // 'true' | 23189 * print(other.closed()); // 'true' |
| 23188 * | 23190 * |
| 23189 * window.location('http://www.mysite.com', 'foo'); | 23191 * window.location('http://www.mysite.com', 'foo'); |
| 23190 * // Does not close this window, as the history has changed. | 23192 * // Does not close this window, as the history has changed. |
| 23191 * window.close(); | 23193 * window.close(); |
| 23192 * print(window.closed()); // 'false' | 23194 * print(window.closed()); // 'false' |
| 23193 * | 23195 * |
| 23194 * See also: | 23196 * See also: |
| 23195 * | 23197 * |
| 23196 * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-wi
ndow-close) from the W3C | 23198 * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-wi
ndow-close) from the W3C |
| 23197 */ | 23199 */ |
| 23198 void close(); | 23200 void close(); |
| 23199 void postMessage(var message, String targetOrigin, [List messagePorts]); | 23201 void postMessage(var message, String targetOrigin, [List messagePorts]); |
| 23200 } | 23202 } |
| 23201 | 23203 |
| 23202 abstract class Location { | 23204 abstract class LocationBase { |
| 23203 void set href(String val); | 23205 void set href(String val); |
| 23204 } | 23206 } |
| 23205 | 23207 |
| 23206 abstract class History { | 23208 abstract class HistoryBase { |
| 23207 void back(); | 23209 void back(); |
| 23208 void forward(); | 23210 void forward(); |
| 23209 void go(int distance); | 23211 void go(int distance); |
| 23210 } | 23212 } |
| 23211 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 23213 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 23212 // for details. All rights reserved. Use of this source code is governed by a | 23214 // for details. All rights reserved. Use of this source code is governed by a |
| 23213 // BSD-style license that can be found in the LICENSE file. | 23215 // BSD-style license that can be found in the LICENSE file. |
| 23214 | 23216 |
| 23215 | 23217 |
| 23216 abstract class CssClassSet implements Set<String> { | 23218 abstract class CssClassSet implements Set<String> { |
| (...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25304 // BSD-style license that can be found in the LICENSE file. | 25306 // BSD-style license that can be found in the LICENSE file. |
| 25305 | 25307 |
| 25306 | 25308 |
| 25307 // Conversions for Window. These check if the window is the local | 25309 // Conversions for Window. These check if the window is the local |
| 25308 // window, and if it's not, wraps or unwraps it with a secure wrapper. | 25310 // window, and if it's not, wraps or unwraps it with a secure wrapper. |
| 25309 // We need to test for EventTarget here as well as it's a base type. | 25311 // We need to test for EventTarget here as well as it's a base type. |
| 25310 // We omit an unwrapper for Window as no methods take a non-local | 25312 // We omit an unwrapper for Window as no methods take a non-local |
| 25311 // window as a parameter. | 25313 // window as a parameter. |
| 25312 | 25314 |
| 25313 | 25315 |
| 25314 Window _convertNativeToDart_Window(win) { | 25316 WindowBase _convertNativeToDart_Window(win) { |
| 25315 return _DOMWindowCrossFrame._createSafe(win); | 25317 return _DOMWindowCrossFrame._createSafe(win); |
| 25316 } | 25318 } |
| 25317 | 25319 |
| 25318 EventTarget _convertNativeToDart_EventTarget(e) { | 25320 EventTarget _convertNativeToDart_EventTarget(e) { |
| 25319 // Assume it's a Window if it contains the setInterval property. It may be | 25321 // Assume it's a Window if it contains the setInterval property. It may be |
| 25320 // from a different frame - without a patched prototype - so we cannot | 25322 // from a different frame - without a patched prototype - so we cannot |
| 25321 // rely on Dart type checking. | 25323 // rely on Dart type checking. |
| 25322 if (JS('bool', r'"setInterval" in #', e)) | 25324 if (JS('bool', r'"setInterval" in #', e)) |
| 25323 return _DOMWindowCrossFrame._createSafe(e); | 25325 return _DOMWindowCrossFrame._createSafe(e); |
| 25324 else | 25326 else |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25374 imageData.data, imageData.height, imageData.width); | 25376 imageData.data, imageData.height, imageData.width); |
| 25375 } | 25377 } |
| 25376 return imageData; | 25378 return imageData; |
| 25377 } | 25379 } |
| 25378 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25380 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 25379 // for details. All rights reserved. Use of this source code is governed by a | 25381 // for details. All rights reserved. Use of this source code is governed by a |
| 25380 // BSD-style license that can be found in the LICENSE file. | 25382 // BSD-style license that can be found in the LICENSE file. |
| 25381 | 25383 |
| 25382 | 25384 |
| 25383 // TODO(vsm): Unify with Dartium version. | 25385 // TODO(vsm): Unify with Dartium version. |
| 25384 class _DOMWindowCrossFrame implements Window { | 25386 class _DOMWindowCrossFrame implements WindowBase { |
| 25385 // Private window. Note, this is a window in another frame, so it | 25387 // Private window. Note, this is a window in another frame, so it |
| 25386 // cannot be typed as "Window" as its prototype is not patched | 25388 // cannot be typed as "Window" as its prototype is not patched |
| 25387 // properly. Its fields and methods can only be accessed via JavaScript. | 25389 // properly. Its fields and methods can only be accessed via JavaScript. |
| 25388 var _window; | 25390 var _window; |
| 25389 | 25391 |
| 25390 // Fields. | 25392 // Fields. |
| 25391 History get history => | 25393 HistoryBase get history => |
| 25392 _HistoryCrossFrame._createSafe(JS('History', '#.history', _window)); | 25394 _HistoryCrossFrame._createSafe(JS('HistoryBase', '#.history', _window)); |
| 25393 Location get location => | 25395 LocationBase get location => |
| 25394 _LocationCrossFrame._createSafe(JS('Location', '#.location', _window)); | 25396 _LocationCrossFrame._createSafe(JS('LocationBase', '#.location', _window)); |
| 25395 | 25397 |
| 25396 // TODO(vsm): Add frames to navigate subframes. See 2312. | 25398 // TODO(vsm): Add frames to navigate subframes. See 2312. |
| 25397 | 25399 |
| 25398 bool get closed => JS('bool', '#.closed', _window); | 25400 bool get closed => JS('bool', '#.closed', _window); |
| 25399 | 25401 |
| 25400 Window get opener => _createSafe(JS('Window', '#.opener', _window)); | 25402 WindowBase get opener => _createSafe(JS('WindowBase', '#.opener', _window)); |
| 25401 | 25403 |
| 25402 Window get parent => _createSafe(JS('Window', '#.parent', _window)); | 25404 WindowBase get parent => _createSafe(JS('WindowBase', '#.parent', _window)); |
| 25403 | 25405 |
| 25404 Window get top => _createSafe(JS('Window', '#.top', _window)); | 25406 WindowBase get top => _createSafe(JS('WindowBase', '#.top', _window)); |
| 25405 | 25407 |
| 25406 // Methods. | 25408 // Methods. |
| 25407 void close() => JS('void', '#.close()', _window); | 25409 void close() => JS('void', '#.close()', _window); |
| 25408 | 25410 |
| 25409 void postMessage(var message, String targetOrigin, [List messagePorts = null])
{ | 25411 void postMessage(var message, String targetOrigin, [List messagePorts = null])
{ |
| 25410 if (messagePorts == null) { | 25412 if (messagePorts == null) { |
| 25411 JS('void', '#.postMessage(#,#)', _window, message, targetOrigin); | 25413 JS('void', '#.postMessage(#,#)', _window, message, targetOrigin); |
| 25412 } else { | 25414 } else { |
| 25413 JS('void', '#.postMessage(#,#,#)', _window, message, targetOrigin, message
Ports); | 25415 JS('void', '#.postMessage(#,#,#)', _window, message, targetOrigin, message
Ports); |
| 25414 } | 25416 } |
| 25415 } | 25417 } |
| 25416 | 25418 |
| 25417 // Implementation support. | 25419 // Implementation support. |
| 25418 _DOMWindowCrossFrame(this._window); | 25420 _DOMWindowCrossFrame(this._window); |
| 25419 | 25421 |
| 25420 static Window _createSafe(w) { | 25422 static WindowBase _createSafe(w) { |
| 25421 if (identical(w, window)) { | 25423 if (identical(w, window)) { |
| 25422 return w; | 25424 return w; |
| 25423 } else { | 25425 } else { |
| 25424 // TODO(vsm): Cache or implement equality. | 25426 // TODO(vsm): Cache or implement equality. |
| 25425 return new _DOMWindowCrossFrame(w); | 25427 return new _DOMWindowCrossFrame(w); |
| 25426 } | 25428 } |
| 25427 } | 25429 } |
| 25428 } | 25430 } |
| 25429 | 25431 |
| 25430 class _LocationCrossFrame implements Location { | 25432 class _LocationCrossFrame implements LocationBase { |
| 25431 // Private location. Note, this is a location object in another frame, so it | 25433 // Private location. Note, this is a location object in another frame, so it |
| 25432 // cannot be typed as "Location" as its prototype is not patched | 25434 // cannot be typed as "Location" as its prototype is not patched |
| 25433 // properly. Its fields and methods can only be accessed via JavaScript. | 25435 // properly. Its fields and methods can only be accessed via JavaScript. |
| 25434 var _location; | 25436 var _location; |
| 25435 | 25437 |
| 25436 void set href(String val) => _setHref(_location, val); | 25438 void set href(String val) => _setHref(_location, val); |
| 25437 static void _setHref(location, val) { | 25439 static void _setHref(location, val) { |
| 25438 JS('void', '#.href = #', location, val); | 25440 JS('void', '#.href = #', location, val); |
| 25439 } | 25441 } |
| 25440 | 25442 |
| 25441 // Implementation support. | 25443 // Implementation support. |
| 25442 _LocationCrossFrame(this._location); | 25444 _LocationCrossFrame(this._location); |
| 25443 | 25445 |
| 25444 static Location _createSafe(location) { | 25446 static LocationBase _createSafe(location) { |
| 25445 if (identical(location, window.location)) { | 25447 if (identical(location, window.location)) { |
| 25446 return location; | 25448 return location; |
| 25447 } else { | 25449 } else { |
| 25448 // TODO(vsm): Cache or implement equality. | 25450 // TODO(vsm): Cache or implement equality. |
| 25449 return new _LocationCrossFrame(location); | 25451 return new _LocationCrossFrame(location); |
| 25450 } | 25452 } |
| 25451 } | 25453 } |
| 25452 } | 25454 } |
| 25453 | 25455 |
| 25454 class _HistoryCrossFrame implements History { | 25456 class _HistoryCrossFrame implements HistoryBase { |
| 25455 // Private history. Note, this is a history object in another frame, so it | 25457 // Private history. Note, this is a history object in another frame, so it |
| 25456 // cannot be typed as "History" as its prototype is not patched | 25458 // cannot be typed as "History" as its prototype is not patched |
| 25457 // properly. Its fields and methods can only be accessed via JavaScript. | 25459 // properly. Its fields and methods can only be accessed via JavaScript. |
| 25458 var _history; | 25460 var _history; |
| 25459 | 25461 |
| 25460 void back() => JS('void', '#.back()', _history); | 25462 void back() => JS('void', '#.back()', _history); |
| 25461 | 25463 |
| 25462 void forward() => JS('void', '#.forward()', _history); | 25464 void forward() => JS('void', '#.forward()', _history); |
| 25463 | 25465 |
| 25464 void go(int distance) => JS('void', '#.go(#)', _history, distance); | 25466 void go(int distance) => JS('void', '#.go(#)', _history, distance); |
| 25465 | 25467 |
| 25466 // Implementation support. | 25468 // Implementation support. |
| 25467 _HistoryCrossFrame(this._history); | 25469 _HistoryCrossFrame(this._history); |
| 25468 | 25470 |
| 25469 static History _createSafe(h) { | 25471 static HistoryBase _createSafe(h) { |
| 25470 if (identical(h, window.history)) { | 25472 if (identical(h, window.history)) { |
| 25471 return h; | 25473 return h; |
| 25472 } else { | 25474 } else { |
| 25473 // TODO(vsm): Cache or implement equality. | 25475 // TODO(vsm): Cache or implement equality. |
| 25474 return new _HistoryCrossFrame(h); | 25476 return new _HistoryCrossFrame(h); |
| 25475 } | 25477 } |
| 25476 } | 25478 } |
| 25477 } | 25479 } |
| 25478 /** | 25480 /** |
| 25479 * A custom KeyboardEvent that attempts to eliminate cross-browser | 25481 * A custom KeyboardEvent that attempts to eliminate cross-browser |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25566 /** | 25568 /** |
| 25567 * The type of key event that occurred. One of "keydown", "keyup", or | 25569 * The type of key event that occurred. One of "keydown", "keyup", or |
| 25568 * "keypress". | 25570 * "keypress". |
| 25569 */ | 25571 */ |
| 25570 String get type => _parent.type; | 25572 String get type => _parent.type; |
| 25571 Window get view => _parent.view; | 25573 Window get view => _parent.view; |
| 25572 void preventDefault() => _parent.preventDefault(); | 25574 void preventDefault() => _parent.preventDefault(); |
| 25573 void stopImmediatePropagation() => _parent.stopImmediatePropagation(); | 25575 void stopImmediatePropagation() => _parent.stopImmediatePropagation(); |
| 25574 void stopPropagation() => _parent.stopPropagation(); | 25576 void stopPropagation() => _parent.stopPropagation(); |
| 25575 void $dom_initUIEvent(String type, bool canBubble, bool cancelable, | 25577 void $dom_initUIEvent(String type, bool canBubble, bool cancelable, |
| 25576 LocalWindow view, int detail) { | 25578 Window view, int detail) { |
| 25577 throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent."); | 25579 throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent."); |
| 25578 } | 25580 } |
| 25579 void $dom_initEvent(String eventTypeArg, bool canBubbleArg, | 25581 void $dom_initEvent(String eventTypeArg, bool canBubbleArg, |
| 25580 bool cancelableArg) { | 25582 bool cancelableArg) { |
| 25581 throw new UnsupportedError("Cannot initialize an Event from a KeyEvent."); | 25583 throw new UnsupportedError("Cannot initialize an Event from a KeyEvent."); |
| 25582 } | 25584 } |
| 25583 String get _shadowKeyIdentifier => JS('String', '#.keyIdentifier', _parent); | 25585 String get _shadowKeyIdentifier => JS('String', '#.keyIdentifier', _parent); |
| 25584 | 25586 |
| 25585 int get $dom_charCode => charCode; | 25587 int get $dom_charCode => charCode; |
| 25586 int get $dom_keyCode => keyCode; | 25588 int get $dom_keyCode => keyCode; |
| 25587 EventTarget get target => _parent.target; | 25589 EventTarget get target => _parent.target; |
| 25588 String get $dom_keyIdentifier { | 25590 String get $dom_keyIdentifier { |
| 25589 throw new UnsupportedError("keyIdentifier is unsupported."); | 25591 throw new UnsupportedError("keyIdentifier is unsupported."); |
| 25590 } | 25592 } |
| 25591 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, | 25593 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| 25592 LocalWindow view, String keyIdentifier, int keyLocation, bool ctrlKey, | 25594 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| 25593 bool altKey, bool shiftKey, bool metaKey, | 25595 bool altKey, bool shiftKey, bool metaKey, |
| 25594 bool altGraphKey) { | 25596 bool altGraphKey) { |
| 25595 throw new UnsupportedError( | 25597 throw new UnsupportedError( |
| 25596 "Cannot initialize a KeyboardEvent from a KeyEvent."); | 25598 "Cannot initialize a KeyboardEvent from a KeyEvent."); |
| 25597 } | 25599 } |
| 25598 } | 25600 } |
| 25599 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25601 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 25600 // for details. All rights reserved. Use of this source code is governed by a | 25602 // for details. All rights reserved. Use of this source code is governed by a |
| 25601 // BSD-style license that can be found in the LICENSE file. | 25603 // BSD-style license that can be found in the LICENSE file. |
| 25602 | 25604 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25617 } | 25619 } |
| 25618 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 25620 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 25619 // for details. All rights reserved. Use of this source code is governed by a | 25621 // for details. All rights reserved. Use of this source code is governed by a |
| 25620 // BSD-style license that can be found in the LICENSE file. | 25622 // BSD-style license that can be found in the LICENSE file. |
| 25621 | 25623 |
| 25622 | 25624 |
| 25623 // On Firefox 11, the object obtained from 'window.location' is very strange. | 25625 // On Firefox 11, the object obtained from 'window.location' is very strange. |
| 25624 // It can't be monkey-patched and seems immune to putting methods on | 25626 // It can't be monkey-patched and seems immune to putting methods on |
| 25625 // Object.prototype. We are forced to wrap the object. | 25627 // Object.prototype. We are forced to wrap the object. |
| 25626 | 25628 |
| 25627 class _LocationWrapper implements LocalLocation { | 25629 class _LocationWrapper implements Location { |
| 25628 | 25630 |
| 25629 final _ptr; // Opaque reference to real location. | 25631 final _ptr; // Opaque reference to real location. |
| 25630 | 25632 |
| 25631 _LocationWrapper(this._ptr); | 25633 _LocationWrapper(this._ptr); |
| 25632 | 25634 |
| 25633 // TODO(sra): Replace all the _set and _get calls with 'JS' forms. | 25635 // TODO(sra): Replace all the _set and _get calls with 'JS' forms. |
| 25634 | 25636 |
| 25635 // final List<String> ancestorOrigins; | 25637 // final List<String> ancestorOrigins; |
| 25636 List<String> get ancestorOrigins => _get(_ptr, 'ancestorOrigins'); | 25638 List<String> get ancestorOrigins => _get(_ptr, 'ancestorOrigins'); |
| 25637 | 25639 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25906 T next() { | 25908 T next() { |
| 25907 if (!hasNext) { | 25909 if (!hasNext) { |
| 25908 throw new StateError("No more elements"); | 25910 throw new StateError("No more elements"); |
| 25909 } | 25911 } |
| 25910 return _array[_pos++]; | 25912 return _array[_pos++]; |
| 25911 } | 25913 } |
| 25912 | 25914 |
| 25913 final List<T> _array; | 25915 final List<T> _array; |
| 25914 int _pos; | 25916 int _pos; |
| 25915 } | 25917 } |
| OLD | NEW |