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 /** |
| 8 * Represents the top level context object for web scripting. |
| 9 * |
| 10 * In a web browser, a [Window] object represents the actual browser window. |
| 11 * In a multi-tabbed browser, each tab has its own [Window] object. A [Window] |
| 12 * is the container that displays a [Document]'s content. All web scripting |
| 13 * happens within the context of a [Window] object. |
| 14 * |
| 15 * **Note:** that this class represents any window, whereas [LocalWindow] is |
| 16 * used to access the properties and content of the current window. |
| 17 * |
| 18 * See also: |
| 19 * |
| 20 * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN. |
| 21 * * [Window](http://www.w3.org/TR/Window/) from the W3C. |
| 22 */ |
7 abstract class Window { | 23 abstract class Window { |
8 // Fields. | 24 // Fields. |
9 Location get location; | 25 Location get location; |
10 History get history; | 26 History get history; |
11 | 27 |
12 bool get closed; | 28 bool get closed; |
13 Window get opener; | 29 Window get opener; |
14 Window get parent; | 30 Window get parent; |
15 Window get top; | 31 Window get top; |
16 | 32 |
17 // Methods. | 33 // Methods. |
18 void focus(); | 34 void focus(); |
19 void blur(); | 35 void blur(); |
20 void close(); | 36 void close(); |
21 void postMessage(var message, String targetOrigin, [List messagePorts = null])
; | 37 void postMessage(var message, String targetOrigin, [List messagePorts = null])
; |
22 } | 38 } |
23 | 39 |
24 abstract class Location { | 40 abstract class Location { |
25 void set href(String val); | 41 void set href(String val); |
26 } | 42 } |
27 | 43 |
28 abstract class History { | 44 abstract class History { |
29 void back(); | 45 void back(); |
30 void forward(); | 46 void forward(); |
31 void go(int distance); | 47 void go(int distance); |
32 } | 48 } |
OLD | NEW |