OLD | NEW |
1 library html; | 1 library html; |
2 | 2 |
3 import 'dart:isolate'; | 3 import 'dart:isolate'; |
4 import 'dart:json'; | 4 import 'dart:json'; |
5 import 'dart:svg' as svg; | 5 import 'dart:svg' as svg; |
6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
7 // for details. All rights reserved. Use of this source code is governed by a | 7 // for details. All rights reserved. Use of this source code is governed by a |
8 // BSD-style license that can be found in the LICENSE file. | 8 // BSD-style license that can be found in the LICENSE file. |
9 | 9 |
10 // DO NOT EDIT | 10 // DO NOT EDIT |
(...skipping 22126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22137 * **Note:** This class represents any window, whereas [LocalWindow] is | 22137 * **Note:** This class represents any window, whereas [LocalWindow] is |
22138 * used to access the properties and content of the current window. | 22138 * used to access the properties and content of the current window. |
22139 * | 22139 * |
22140 * See also: | 22140 * See also: |
22141 * | 22141 * |
22142 * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN. | 22142 * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN. |
22143 * * [Window](http://www.w3.org/TR/Window/) from the W3C. | 22143 * * [Window](http://www.w3.org/TR/Window/) from the W3C. |
22144 */ | 22144 */ |
22145 abstract class Window { | 22145 abstract class Window { |
22146 // Fields. | 22146 // Fields. |
| 22147 |
| 22148 /** |
| 22149 * The [Location] object representing the current location of this window. |
| 22150 * |
| 22151 * Location currentLocation = window.location; |
| 22152 * print(currentLocation.href); // 'http://www.example.com:80/' |
| 22153 */ |
22147 Location get location; | 22154 Location get location; |
22148 History get history; | 22155 History get history; |
22149 | 22156 |
| 22157 /** |
| 22158 * Indicates whether the window is closed. |
| 22159 * |
| 22160 * print(window.closed); // 'false' |
| 22161 * window.close(); |
| 22162 * print(window.closed); // 'true' |
| 22163 */ |
22150 bool get closed; | 22164 bool get closed; |
| 22165 |
| 22166 /** |
| 22167 * A reference to the [Window] that opened this [Window]. |
| 22168 * |
| 22169 * Window thisWindow = window; |
| 22170 * Window otherWindow = thisWindow.open('http://www.example.com/', 'foo'); |
| 22171 * print(otherWindow.opener == thisWindow); // 'true' |
| 22172 */ |
22151 Window get opener; | 22173 Window get opener; |
| 22174 |
| 22175 /** |
| 22176 * A reference to the parent of this [Window]. |
| 22177 * |
| 22178 * If this [Window] has no parent, [parent] will return a reference to |
| 22179 * the [Window] itself. |
| 22180 * |
| 22181 * IFrameElement myIFrame = new IFrameElement(); |
| 22182 * window.document.body.elements.add(myIFrame); |
| 22183 * print(myIframe.contentWindow.parent == window) // 'true' |
| 22184 * |
| 22185 * print(window.parent == window) // 'true' |
| 22186 */ |
22152 Window get parent; | 22187 Window get parent; |
| 22188 |
| 22189 /** |
| 22190 * A reference to the topmost [Window] in the [Window] heirarchy. |
| 22191 * |
| 22192 * If this [Window] is the topmost [Window], [top] will return a reference to |
| 22193 * the [Window] itself. |
| 22194 * |
| 22195 * // Add an IFrame to the current window. |
| 22196 * IFrameElement myIFrame = new IFrameElement(); |
| 22197 * window.document.body.elements.add(myIFrame); |
| 22198 * |
| 22199 * // Add an IFrame inside of the other IFrame. |
| 22200 * IFrameElement innerIFrame = new IFrameElement(); |
| 22201 * myIFrame.elements.add(innerIFrame); |
| 22202 * |
| 22203 * print(myIframe.contentWindow.top == window) // 'true' |
| 22204 * print(innerIFrame.contentWindow.top == window) // 'true' |
| 22205 * |
| 22206 * print(window.top == window) // 'true' |
| 22207 */ |
22153 Window get top; | 22208 Window get top; |
22154 | 22209 |
22155 // Methods. | 22210 // Methods. |
22156 void focus(); | 22211 void focus(); |
22157 void blur(); | 22212 void blur(); |
22158 void close(); | 22213 void close(); |
22159 void postMessage(var message, String targetOrigin, [List messagePorts = null])
; | 22214 void postMessage(var message, String targetOrigin, [List messagePorts = null])
; |
22160 } | 22215 } |
22161 | 22216 |
22162 abstract class Location { | 22217 abstract class Location { |
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24991 if (length < 0) throw new ArgumentError('length'); | 25046 if (length < 0) throw new ArgumentError('length'); |
24992 if (start < 0) throw new RangeError.value(start); | 25047 if (start < 0) throw new RangeError.value(start); |
24993 int end = start + length; | 25048 int end = start + length; |
24994 if (end > a.length) throw new RangeError.value(end); | 25049 if (end > a.length) throw new RangeError.value(end); |
24995 for (int i = start; i < end; i++) { | 25050 for (int i = start; i < end; i++) { |
24996 accumulator.add(a[i]); | 25051 accumulator.add(a[i]); |
24997 } | 25052 } |
24998 return accumulator; | 25053 return accumulator; |
24999 } | 25054 } |
25000 } | 25055 } |
OLD | NEW |