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)@Native("Window,DOMWindow") | 9 $(ANNOTATIONS)@Native("Window,DOMWindow") |
10 $(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { | 10 $(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 * (https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY) from MDN. | 289 * (https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY) from MDN. |
290 */ | 290 */ |
291 @DomName('Window.scrollY') | 291 @DomName('Window.scrollY') |
292 @DocsEditable() | 292 @DocsEditable() |
293 int get scrollY => JS('bool', '("scrollY" in #)', this) ? | 293 int get scrollY => JS('bool', '("scrollY" in #)', this) ? |
294 JS('num', '#.scrollY', this).round() : | 294 JS('num', '#.scrollY', this).round() : |
295 document.documentElement.scrollTop; | 295 document.documentElement.scrollTop; |
296 $else | 296 $else |
297 @DomName('Window.pageXOffset') | 297 @DomName('Window.pageXOffset') |
298 @DocsEditable() | 298 @DocsEditable() |
299 int get pageXOffset => _blink.BlinkWindow.instance.pageXOffset_Getter_(this).r
ound(); | 299 int get pageXOffset => _blink.BlinkWindow.instance.pageXOffset_Getter_(unwrap_
jso(this)).round(); |
300 | 300 |
301 @DomName('Window.pageYOffset') | 301 @DomName('Window.pageYOffset') |
302 @DocsEditable() | 302 @DocsEditable() |
303 int get pageYOffset => _blink.BlinkWindow.instance.pageYOffset_Getter_(this).r
ound(); | 303 int get pageYOffset => _blink.BlinkWindow.instance.pageYOffset_Getter_(unwrap_
jso(this)).round(); |
304 | 304 |
305 @DomName('Window.scrollX') | 305 @DomName('Window.scrollX') |
306 @DocsEditable() | 306 @DocsEditable() |
307 int get scrollX => _blink.BlinkWindow.instance.scrollX_Getter_(this).round(); | 307 int get scrollX => _blink.BlinkWindow.instance.scrollX_Getter_(unwrap_jso(this
)).round(); |
308 | 308 |
309 @DomName('Window.scrollY') | 309 @DomName('Window.scrollY') |
310 @DocsEditable() | 310 @DocsEditable() |
311 int get scrollY => _blink.BlinkWindow.instance.scrollY_Getter_(this).round(); | 311 int get scrollY => _blink.BlinkWindow.instance.scrollY_Getter_(unwrap_jso(this
)).round(); |
312 $endif | 312 $endif |
313 } | 313 } |
314 | 314 |
315 $if DART2JS | 315 $if DART2JS |
316 class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent { | 316 class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent { |
317 String _returnValue; | 317 String _returnValue; |
318 | 318 |
319 _BeforeUnloadEvent(Event base): super(base); | 319 _BeforeUnloadEvent(Event base): super(base); |
320 | 320 |
321 String get returnValue => _returnValue; | 321 String get returnValue => _returnValue; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 ElementStream<BeforeUnloadEvent> forElement(Element e, {bool useCapture: false
}) { | 361 ElementStream<BeforeUnloadEvent> forElement(Element e, {bool useCapture: false
}) { |
362 return new _ElementEventStreamImpl(e, _eventType, useCapture); | 362 return new _ElementEventStreamImpl(e, _eventType, useCapture); |
363 } | 363 } |
364 | 364 |
365 ElementStream<BeforeUnloadEvent> _forElementList(ElementList e, | 365 ElementStream<BeforeUnloadEvent> _forElementList(ElementList e, |
366 {bool useCapture: false}) { | 366 {bool useCapture: false}) { |
367 return new _ElementListEventStreamImpl(e, _eventType, useCapture); | 367 return new _ElementListEventStreamImpl(e, _eventType, useCapture); |
368 } | 368 } |
369 } | 369 } |
OLD | NEW |