Chromium Code Reviews| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = | 274 static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent = |
| 275 const _BeforeUnloadEventStreamProvider('beforeunload'); | 275 const _BeforeUnloadEventStreamProvider('beforeunload'); |
| 276 | 276 |
| 277 @DomName('Window.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 | |
| 285 int get scrollX() => Device.isIE ? document.documentElement.scrollLeft : | |
|
blois
2013/07/25 21:30:03
Can this use ('scrollX' in window) ? rather than i
| |
| 286 $dom_scrollX; | |
| 287 int get scrollY() => Device.isIE ? document.documentElement.scrollTop : | |
| 288 $dom_scrollY; | |
| 284 } | 289 } |
| 285 | 290 |
| 286 /** | 291 /** |
| 287 * Event object that is fired before the window is closed. | 292 * Event object that is fired before the window is closed. |
| 288 * | 293 * |
| 289 * The standard window close behavior can be prevented by setting the | 294 * The standard window close behavior can be prevented by setting the |
| 290 * [returnValue]. This will display a dialog to the user confirming that they | 295 * [returnValue]. This will display a dialog to the user confirming that they |
| 291 * want to close the page. | 296 * want to close the page. |
| 292 */ | 297 */ |
| 293 abstract class BeforeUnloadEvent implements Event { | 298 abstract class BeforeUnloadEvent implements Event { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 return wrapped.returnValue; | 337 return wrapped.returnValue; |
| 333 }); | 338 }); |
| 334 | 339 |
| 335 return controller.stream; | 340 return controller.stream; |
| 336 } | 341 } |
| 337 | 342 |
| 338 String getEventType(EventTarget target) { | 343 String getEventType(EventTarget target) { |
| 339 return _eventType; | 344 return _eventType; |
| 340 } | 345 } |
| 341 } | 346 } |
| OLD | NEW |