| 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 @DocsEditable() | 7 @DocsEditable() |
| 8 $if DART2JS | 8 $if DART2JS |
| 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Wind
ow,DOMWindow" { | 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Wind
ow,DOMWindow" { |
| 10 $else | 10 $else |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 return new Point(result.x, result.y); | 264 return new Point(result.x, result.y); |
| 265 } | 265 } |
| 266 | 266 |
| 267 /** | 267 /** |
| 268 * Checks whether [convertPointFromNodeToPage] and | 268 * Checks whether [convertPointFromNodeToPage] and |
| 269 * [convertPointFromPageToNode] are supported on the current platform. | 269 * [convertPointFromPageToNode] are supported on the current platform. |
| 270 */ | 270 */ |
| 271 static bool get supportsPointConversions => _DomPoint.supported; | 271 static bool get supportsPointConversions => _DomPoint.supported; |
| 272 $!MEMBERS | 272 $!MEMBERS |
| 273 | 273 |
| 274 /** |
| 275 * Static factory designed to expose `beforeunload` events to event |
| 276 * handlers that are not necessarily instances of [Window]. |
| 277 * |
| 278 * See [EventStreamProvider] for usage information. |
| 279 */ |
| 274 @DomName('Window.beforeunloadEvent') | 280 @DomName('Window.beforeunloadEvent') |
| 275 @DocsEditable() | |
| 276 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = | 281 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = |
| 277 const _BeforeUnloadEventStreamProvider('beforeunload'); | 282 const _BeforeUnloadEventStreamProvider('beforeunload'); |
| 278 | 283 |
| 284 /// Stream of `beforeunload` events handled by this [Window]. |
| 279 @DomName('Window.onbeforeunload') | 285 @DomName('Window.onbeforeunload') |
| 280 @DocsEditable() | |
| 281 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); | 286 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this); |
| 282 | 287 |
| 283 void moveTo(Point p) { | 288 void moveTo(Point p) { |
| 284 _moveTo(p.x, p.y); | 289 _moveTo(p.x, p.y); |
| 285 } | 290 } |
| 286 | 291 |
| 287 $if DART2JS | 292 $if DART2JS |
| 288 int get scrollX => JS('bool', '("scrollX" in #)', this) ? JS('int', | 293 int get scrollX => JS('bool', '("scrollX" in #)', this) ? JS('int', |
| 289 '#.scrollX', this) : document.documentElement.scrollLeft; | 294 '#.scrollX', this) : document.documentElement.scrollLeft; |
| 290 int get scrollY => JS('bool', '("scrollY" in #)', this) ? JS('int', | 295 int get scrollY => JS('bool', '("scrollY" in #)', this) ? JS('int', |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return wrapped.returnValue; | 331 return wrapped.returnValue; |
| 327 }); | 332 }); |
| 328 | 333 |
| 329 return controller.stream; | 334 return controller.stream; |
| 330 } | 335 } |
| 331 | 336 |
| 332 String getEventType(EventTarget target) { | 337 String getEventType(EventTarget target) { |
| 333 return _eventType; | 338 return _eventType; |
| 334 } | 339 } |
| 335 } | 340 } |
| OLD | NEW |