| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of html; | 5 part of html; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Top-level container for a browser tab or window. | 8 * Top-level container for a browser tab or window. |
| 9 * | 9 * |
| 10 * In a web browser, a [WindowBase] object represents any browser window. This | 10 * In a web browser, a [WindowBase] object represents any browser window. This |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 abstract class WindowBase implements EventTarget { | 26 abstract class WindowBase implements EventTarget { |
| 27 // Fields. | 27 // Fields. |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * The current location of this window. | 30 * The current location of this window. |
| 31 * | 31 * |
| 32 * Location currentLocation = window.location; | 32 * Location currentLocation = window.location; |
| 33 * print(currentLocation.href); // 'http://www.example.com:80/' | 33 * print(currentLocation.href); // 'http://www.example.com:80/' |
| 34 */ | 34 */ |
| 35 LocationBase get location; | 35 LocationBase get location; |
| 36 |
| 37 /** |
| 38 * The current session history for this window. |
| 39 * |
| 40 * ## Other resources |
| 41 * |
| 42 * * [Session history and navigation specification] |
| 43 * (http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html) |
| 44 * from WHATWG. |
| 45 */ |
| 36 HistoryBase get history; | 46 HistoryBase get history; |
| 37 | 47 |
| 38 /** | 48 /** |
| 39 * Indicates whether this window has been closed. | 49 * Indicates whether this window has been closed. |
| 40 * | 50 * |
| 41 * print(window.closed); // 'false' | 51 * print(window.closed); // 'false' |
| 42 * window.close(); | 52 * window.close(); |
| 43 * print(window.closed); // 'true' | 53 * print(window.closed); // 'true' |
| 44 */ | 54 */ |
| 45 bool get closed; | 55 bool get closed; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 * window.location('http://www.mysite.com', 'foo'); | 121 * window.location('http://www.mysite.com', 'foo'); |
| 112 * // Does not close this window, as the history has changed. | 122 * // Does not close this window, as the history has changed. |
| 113 * window.close(); | 123 * window.close(); |
| 114 * print(window.closed()); // 'false' | 124 * print(window.closed()); // 'false' |
| 115 * | 125 * |
| 116 * See also: | 126 * See also: |
| 117 * | 127 * |
| 118 * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-wi
ndow-close) from the W3C | 128 * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-wi
ndow-close) from the W3C |
| 119 */ | 129 */ |
| 120 void close(); | 130 void close(); |
| 131 |
| 132 /** |
| 133 * Sends a cross-origin message. |
| 134 * |
| 135 * ## Other resources |
| 136 * |
| 137 * * [window.postMessage] |
| 138 * (https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) from |
| 139 * MDN. |
| 140 * * [Cross-document messaging] |
| 141 * (http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.
html) |
| 142 * from WHATWG. |
| 143 */ |
| 121 void postMessage(var message, String targetOrigin, [List messagePorts]); | 144 void postMessage(var message, String targetOrigin, [List messagePorts]); |
| 122 } | 145 } |
| 123 | 146 |
| 124 abstract class LocationBase { | 147 abstract class LocationBase { |
| 125 void set href(String val); | 148 void set href(String val); |
| 126 } | 149 } |
| 127 | 150 |
| 128 abstract class HistoryBase { | 151 abstract class HistoryBase { |
| 129 void back(); | 152 void back(); |
| 130 void forward(); | 153 void forward(); |
| 131 void go(int distance); | 154 void go(int distance); |
| 132 } | 155 } |
| OLD | NEW |