Index: tools/dom/templates/html/impl/impl_Window.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate |
index 6b846f020420176217d48266485e2b3b59bfb01a..1c887777f862a644b825817c1cc583490ab3dcc3 100644 |
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate |
@@ -254,6 +254,14 @@ $!MEMBERS |
} |
$if DART2JS |
+ @DomName('Window.pageXOffset') |
+ @DocsEditable() |
+ int get pageXOffset => JS('num', '#.pageXOffset', this).round(); |
+ |
+ @DomName('Window.pageYOffset') |
+ @DocsEditable() |
+ int get pageYOffset => JS('num', '#.pageYOffset', this).round(); |
+ |
/** |
* The distance this window has been scrolled horizontally. |
* |
@@ -264,8 +272,11 @@ $if DART2JS |
* * [scrollX] |
* (https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollX) from MDN. |
*/ |
- int get scrollX => JS('bool', '("scrollX" in #)', this) ? JS('int', |
- '#.scrollX', this) : document.documentElement.scrollLeft; |
+ @DomName('Window.scrollX') |
+ @DocsEditable() |
+ int get scrollX => JS('bool', '("scrollX" in #)', this) ? |
+ JS('num', '#.scrollX', this).round() : |
+ document.documentElement.scrollLeft; |
/** |
* The distance this window has been scrolled vertically. |
@@ -277,8 +288,27 @@ $if DART2JS |
* * [scrollY] |
* (https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY) from MDN. |
*/ |
- int get scrollY => JS('bool', '("scrollY" in #)', this) ? JS('int', |
- '#.scrollY', this) : document.documentElement.scrollTop; |
+ @DomName('Window.scrollY') |
+ @DocsEditable() |
+ int get scrollY => JS('bool', '("scrollY" in #)', this) ? |
+ JS('num', '#.scrollY', this).round() : |
+ document.documentElement.scrollTop; |
+$else |
+ @DomName('Window.pageXOffset') |
+ @DocsEditable() |
+ int get pageXOffset => _blink.BlinkWindow.instance.pageXOffset_Getter_(this).round(); |
+ |
+ @DomName('Window.pageYOffset') |
+ @DocsEditable() |
+ int get pageYOffset => _blink.BlinkWindow.instance.pageYOffset_Getter_(this).round(); |
+ |
+ @DomName('Window.scrollX') |
+ @DocsEditable() |
+ int get scrollX => _blink.BlinkWindow.instance.scrollX_Getter_(this).round(); |
+ |
+ @DomName('Window.scrollY') |
+ @DocsEditable() |
+ int get scrollY => _blink.BlinkWindow.instance.scrollY_Getter_(this).round(); |
$endif |
} |