| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 * [animationFrame], which returns a Future. | 144 * [animationFrame], which returns a Future. |
| 145 * | 145 * |
| 146 * Returns a non-zero valued integer to represent the request id for this | 146 * Returns a non-zero valued integer to represent the request id for this |
| 147 * request. This value only needs to be saved if you intend to call | 147 * request. This value only needs to be saved if you intend to call |
| 148 * [cancelAnimationFrame] so you can specify the particular animation to | 148 * [cancelAnimationFrame] so you can specify the particular animation to |
| 149 * cancel. | 149 * cancel. |
| 150 * | 150 * |
| 151 * Note: The supplied [callback] needs to call [requestAnimationFrame] again | 151 * Note: The supplied [callback] needs to call [requestAnimationFrame] again |
| 152 * for the animation to continue. | 152 * for the animation to continue. |
| 153 */ | 153 */ |
| 154 @DomName('DOMWindow.requestAnimationFrame') | 154 @DomName('Window.requestAnimationFrame') |
| 155 int requestAnimationFrame(RequestAnimationFrameCallback callback) { | 155 int requestAnimationFrame(RequestAnimationFrameCallback callback) { |
| 156 _ensureRequestAnimationFrame(); | 156 _ensureRequestAnimationFrame(); |
| 157 return _requestAnimationFrame(callback); | 157 return _requestAnimationFrame(callback); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void cancelAnimationFrame(int id) { | 160 void cancelAnimationFrame(int id) { |
| 161 _ensureRequestAnimationFrame(); | 161 _ensureRequestAnimationFrame(); |
| 162 _cancelAnimationFrame(id); | 162 _cancelAnimationFrame(id); |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 * true, the application will request permission from the user to create | 235 * true, the application will request permission from the user to create |
| 236 * lasting storage. This storage cannot be freed without the user's | 236 * lasting storage. This storage cannot be freed without the user's |
| 237 * permission. Returns a [Future] whose value stores a reference to the | 237 * permission. Returns a [Future] whose value stores a reference to the |
| 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('Window.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('Window.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('Window.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('Window.onbeforeunload') |
| 278 @DocsEditable() | 278 @DocsEditable() |
| 279 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); | 279 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); |
| 280 | 280 |
| 281 void moveTo(Point p) { | 281 void moveTo(Point p) { |
| 282 $dom_moveTo(p.x, p.y); | 282 $dom_moveTo(p.x, p.y); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 /** | 286 /** |
| 287 * Event object that is fired before the window is closed. | 287 * Event object that is fired before the window is closed. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 return wrapped.returnValue; | 332 return wrapped.returnValue; |
| 333 }); | 333 }); |
| 334 | 334 |
| 335 return controller.stream; | 335 return controller.stream; |
| 336 } | 336 } |
| 337 | 337 |
| 338 String getEventType(EventTarget target) { | 338 String getEventType(EventTarget target) { |
| 339 return _eventType; | 339 return _eventType; |
| 340 } | 340 } |
| 341 } | 341 } |
| OLD | NEW |