| 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 $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $if DART2JS | 7 $if DART2JS |
| 8 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Wind
ow,DOMWindow" { | 8 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Wind
ow,DOMWindow" { |
| 9 $else | 9 $else |
| 10 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 10 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 /** | 197 /** |
| 198 * Gets an instance of the Indexed DB factory to being using Indexed DB. | 198 * Gets an instance of the Indexed DB factory to being using Indexed DB. |
| 199 * | 199 * |
| 200 * Use [IdbFactory.supported] to check if Indexed DB is supported on the | 200 * Use [IdbFactory.supported] to check if Indexed DB is supported on the |
| 201 * current platform. | 201 * current platform. |
| 202 */ | 202 */ |
| 203 @SupportedBrowser(SupportedBrowser.CHROME, '23.0') | 203 @SupportedBrowser(SupportedBrowser.CHROME, '23.0') |
| 204 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0') | 204 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0') |
| 205 @SupportedBrowser(SupportedBrowser.IE, '10.0') | 205 @SupportedBrowser(SupportedBrowser.IE, '10.0') |
| 206 @Experimental | 206 @Experimental() |
| 207 IdbFactory get indexedDB => | 207 IdbFactory get indexedDB => |
| 208 JS('IdbFactory|Null', // If not supported, returns `null`. | 208 JS('IdbFactory|Null', // If not supported, returns `null`. |
| 209 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', | 209 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', |
| 210 this, this, this); | 210 this, this, this); |
| 211 | 211 |
| 212 @DomName('Window.console') | 212 @DomName('Window.console') |
| 213 Console get console => Console._safeConsole; | 213 Console get console => Console._safeConsole; |
| 214 | 214 |
| 215 /// Checks if _setImmediate is supported. | 215 /// Checks if _setImmediate is supported. |
| 216 static bool get _supportsSetImmediate => | 216 static bool get _supportsSetImmediate => |
| (...skipping 21 matching lines...) Expand all Loading... |
| 238 * sandboxed file system for use. Because the file system is sandboxed, | 238 * sandboxed file system for use. Because the file system is sandboxed, |
| 239 * applications cannot access file systems created in other web pages. | 239 * applications cannot access file systems created in other web pages. |
| 240 */ | 240 */ |
| 241 Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) { | 241 Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) { |
| 242 return _requestFileSystem(persistent? 1 : 0, size); | 242 return _requestFileSystem(persistent? 1 : 0, size); |
| 243 } | 243 } |
| 244 | 244 |
| 245 @DomName('DOMWindow.convertPointFromNodeToPage') | 245 @DomName('DOMWindow.convertPointFromNodeToPage') |
| 246 @SupportedBrowser(SupportedBrowser.CHROME) | 246 @SupportedBrowser(SupportedBrowser.CHROME) |
| 247 @SupportedBrowser(SupportedBrowser.SAFARI) | 247 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 248 @Experimental | 248 @Experimental() |
| 249 Point convertPointFromNodeToPage(Node node, Point point) { | 249 Point convertPointFromNodeToPage(Node node, Point point) { |
| 250 var result = _convertPointFromNodeToPage(node, | 250 var result = _convertPointFromNodeToPage(node, |
| 251 new _DomPoint(point.x, point.y)); | 251 new _DomPoint(point.x, point.y)); |
| 252 return new Point(result.x, result.y); | 252 return new Point(result.x, result.y); |
| 253 } | 253 } |
| 254 | 254 |
| 255 @DomName('DOMWindow.convertPointFromPageToNode') | 255 @DomName('DOMWindow.convertPointFromPageToNode') |
| 256 @SupportedBrowser(SupportedBrowser.CHROME) | 256 @SupportedBrowser(SupportedBrowser.CHROME) |
| 257 @SupportedBrowser(SupportedBrowser.SAFARI) | 257 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 258 @Experimental | 258 @Experimental() |
| 259 Point convertPointFromPageToNode(Node node, Point point) { | 259 Point convertPointFromPageToNode(Node node, Point point) { |
| 260 var result = _convertPointFromPageToNode(node, | 260 var result = _convertPointFromPageToNode(node, |
| 261 new _DomPoint(point.x, point.y)); | 261 new _DomPoint(point.x, point.y)); |
| 262 return new Point(result.x, result.y); | 262 return new Point(result.x, result.y); |
| 263 } | 263 } |
| 264 | 264 |
| 265 /** | 265 /** |
| 266 * Checks whether [convertPointFromNodeToPage] and | 266 * Checks whether [convertPointFromNodeToPage] and |
| 267 * [convertPointFromPageToNode] are supported on the current platform. | 267 * [convertPointFromPageToNode] are supported on the current platform. |
| 268 */ | 268 */ |
| 269 static bool get supportsPointConversions => _DomPoint.supported; | 269 static bool get supportsPointConversions => _DomPoint.supported; |
| 270 $!MEMBERS | 270 $!MEMBERS |
| 271 | 271 |
| 272 @DomName('DOMWindow.beforeunloadEvent') | 272 @DomName('DOMWindow.beforeunloadEvent') |
| 273 @DocsEditable | 273 @DocsEditable() |
| 274 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = | 274 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = |
| 275 const _BeforeUnloadEventStreamProvider('beforeunload'); | 275 const _BeforeUnloadEventStreamProvider('beforeunload'); |
| 276 | 276 |
| 277 @DomName('DOMWindow.onbeforeunload') | 277 @DomName('DOMWindow.onbeforeunload') |
| 278 @DocsEditable | 278 @DocsEditable() |
| 279 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); | 279 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); |
| 280 } | 280 } |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Event object that is fired before the window is closed. | 283 * Event object that is fired before the window is closed. |
| 284 * | 284 * |
| 285 * The standard window close behavior can be prevented by setting the | 285 * The standard window close behavior can be prevented by setting the |
| 286 * [returnValue]. This will display a dialog to the user confirming that they | 286 * [returnValue]. This will display a dialog to the user confirming that they |
| 287 * want to close the page. | 287 * want to close the page. |
| 288 */ | 288 */ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return wrapped.returnValue; | 328 return wrapped.returnValue; |
| 329 }); | 329 }); |
| 330 | 330 |
| 331 return controller.stream; | 331 return controller.stream; |
| 332 } | 332 } |
| 333 | 333 |
| 334 String getEventType(EventTarget target) { | 334 String getEventType(EventTarget target) { |
| 335 return _eventType; | 335 return _eventType; |
| 336 } | 336 } |
| 337 } | 337 } |
| OLD | NEW |