Title: [206109] trunk
Revision
206109
Author
cdu...@apple.com
Date
2016-09-19 13:35:47 -0700 (Mon, 19 Sep 2016)

Log Message

Window's pageXOffset / pageYOffset attributes should be replaceable
https://bugs.webkit.org/show_bug.cgi?id=162046

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/browsers/the-window-object/window-properties-expected.txt:

Source/WebCore:

Window's pageXOffset / pageYOffset attributes should be replaceable as per:
- https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface

Firefox agrees with the specification.

No new tests, rebaselined existing test.

* page/DOMWindow.h:
* page/DOMWindow.idl:

LayoutTests:

Update existing tests to reflect behavior change.

* fast/dom/Window/get-set-properties-expected.txt:
* fast/dom/Window/get-set-properties.html:
* js/dom/var-declarations-shadowing-expected.txt:
* js/dom/var-declarations-shadowing.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206108 => 206109)


--- trunk/LayoutTests/ChangeLog	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/ChangeLog	2016-09-19 20:35:47 UTC (rev 206109)
@@ -1,3 +1,17 @@
+2016-09-19  Chris Dumez  <cdu...@apple.com>
+
+        Window's pageXOffset / pageYOffset attributes should be replaceable
+        https://bugs.webkit.org/show_bug.cgi?id=162046
+
+        Reviewed by Darin Adler.
+
+        Update existing tests to reflect behavior change.
+
+        * fast/dom/Window/get-set-properties-expected.txt:
+        * fast/dom/Window/get-set-properties.html:
+        * js/dom/var-declarations-shadowing-expected.txt:
+        * js/dom/var-declarations-shadowing.html:
+
 2016-09-19  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Scope sidebar shows "Closure" instead of "Local" when paused in anonymous function

Modified: trunk/LayoutTests/fast/dom/Window/get-set-properties-expected.txt (206108 => 206109)


--- trunk/LayoutTests/fast/dom/Window/get-set-properties-expected.txt	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/fast/dom/Window/get-set-properties-expected.txt	2016-09-19 20:35:47 UTC (rev 206109)
@@ -243,6 +243,10 @@
 PASS: canSet('scrollX') should be 'true' and is.
 PASS: canGet('scrollY') should be 'true' and is.
 PASS: canSet('scrollY') should be 'true' and is.
+PASS: canGet('pageXOffset') should be 'true' and is.
+PASS: canSet('pageXOffset') should be 'true' and is.
+PASS: canGet('pageYOffset') should be 'true' and is.
+PASS: canSet('pageYOffset') should be 'true' and is.
 PASS: canGet('scrollbars') should be 'true' and is.
 PASS: canSet('scrollbars') should be 'true' and is.
 PASS: canGet('self') should be 'true' and is.
@@ -262,10 +266,6 @@
 PASS: canSet('history') should be 'false' and is.
 PASS: canGet('navigator') should be 'true' and is.
 PASS: canSet('navigator') should be 'false' and is.
-PASS: canGet('pageXOffset') should be 'true' and is.
-PASS: canSet('pageXOffset') should be 'false' and is.
-PASS: canGet('pageYOffset') should be 'true' and is.
-PASS: canSet('pageYOffset') should be 'false' and is.
 PASS: canGet('window') should be 'true' and is.
 PASS: canSet('window') should be 'false' and is.
 PASS: canGet('top') should be 'true' and is.

Modified: trunk/LayoutTests/fast/dom/Window/get-set-properties.html (206108 => 206109)


--- trunk/LayoutTests/fast/dom/Window/get-set-properties.html	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/fast/dom/Window/get-set-properties.html	2016-09-19 20:35:47 UTC (rev 206109)
@@ -189,6 +189,8 @@
     "screenY", 
     "scrollX", 
     "scrollY", 
+    "pageXOffset",
+    "pageYOffset",
     "scrollbars",
     "self",
     "statusbar",
@@ -200,8 +202,6 @@
     "document",
     "history",
     "navigator",
-    "pageXOffset",
-    "pageYOffset",
     "window",
     "top"
 ];

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206108 => 206109)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-09-19 20:35:47 UTC (rev 206109)
@@ -1,3 +1,14 @@
+2016-09-19  Chris Dumez  <cdu...@apple.com>
+
+        Window's pageXOffset / pageYOffset attributes should be replaceable
+        https://bugs.webkit.org/show_bug.cgi?id=162046
+
+        Reviewed by Darin Adler.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/html/browsers/the-window-object/window-properties-expected.txt:
+
 2016-09-14  Jer Noble  <jer.no...@apple.com>
 
         [media-source] fix imported/w3c/web-platform-tests/media-source/mediasource-duration.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties-expected.txt (206108 => 206109)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties-expected.txt	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties-expected.txt	2016-09-19 20:35:47 UTC (rev 206109)
@@ -156,8 +156,8 @@
 PASS Window replaceable attribute: screen 
 PASS Window replaceable attribute: scrollX 
 PASS Window replaceable attribute: scrollY 
-FAIL Window replaceable attribute: pageXOffset assert_equals: expected "function" but got "undefined"
-FAIL Window replaceable attribute: pageYOffset assert_equals: expected "function" but got "undefined"
+PASS Window replaceable attribute: pageXOffset 
+PASS Window replaceable attribute: pageYOffset 
 PASS Window replaceable attribute: innerWidth 
 PASS Window replaceable attribute: innerHeight 
 PASS Window replaceable attribute: screenX 

Modified: trunk/LayoutTests/js/dom/var-declarations-shadowing-expected.txt (206108 => 206109)


--- trunk/LayoutTests/js/dom/var-declarations-shadowing-expected.txt	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/js/dom/var-declarations-shadowing-expected.txt	2016-09-19 20:35:47 UTC (rev 206109)
@@ -85,10 +85,10 @@
 -----
 PASS: frameElement == marker should be false and is.
 PASS: eval('frameElement == marker') should be false and is.
-PASS: pageXOffset == marker should be false and is.
-PASS: eval('pageXOffset == marker') should be false and is.
-PASS: pageYOffset == marker should be false and is.
-PASS: eval('pageYOffset == marker') should be false and is.
+PASS: pageXOffset == marker should be true and is.
+PASS: eval('pageXOffset == marker') should be true and is.
+PASS: pageYOffset == marker should be true and is.
+PASS: eval('pageYOffset == marker') should be true and is.
 PASS: closed == marker should be false and is.
 PASS: eval('closed == marker') should be false and is.
 PASS: window == marker should be false and is.

Modified: trunk/LayoutTests/js/dom/var-declarations-shadowing.html (206108 => 206109)


--- trunk/LayoutTests/js/dom/var-declarations-shadowing.html	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/LayoutTests/js/dom/var-declarations-shadowing.html	2016-09-19 20:35:47 UTC (rev 206109)
@@ -270,14 +270,14 @@
 try {
     eval("var pageXOffset = marker");
 } catch(e) { }
-shouldBe(pageXOffset == marker, "pageXOffset == marker", false);
-shouldBe(eval('pageXOffset == marker'), "eval('pageXOffset == marker')", false);
+shouldBe(pageXOffset == marker, "pageXOffset == marker", true);
+shouldBe(eval('pageXOffset == marker'), "eval('pageXOffset == marker')", true);
 
 try {
     eval("var pageYOffset = marker");
 } catch(e) { }
-shouldBe(pageYOffset == marker, "pageYOffset == marker", false);
-shouldBe(eval('pageYOffset == marker'), "eval('pageYOffset == marker')", false);
+shouldBe(pageYOffset == marker, "pageYOffset == marker", true);
+shouldBe(eval('pageYOffset == marker'), "eval('pageYOffset == marker')", true);
 
 try {
     eval("var closed = marker");

Modified: trunk/Source/WebCore/ChangeLog (206108 => 206109)


--- trunk/Source/WebCore/ChangeLog	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/Source/WebCore/ChangeLog	2016-09-19 20:35:47 UTC (rev 206109)
@@ -1,3 +1,20 @@
+2016-09-19  Chris Dumez  <cdu...@apple.com>
+
+        Window's pageXOffset / pageYOffset attributes should be replaceable
+        https://bugs.webkit.org/show_bug.cgi?id=162046
+
+        Reviewed by Darin Adler.
+
+        Window's pageXOffset / pageYOffset attributes should be replaceable as per:
+        - https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
+
+        Firefox agrees with the specification.
+
+        No new tests, rebaselined existing test.
+
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+
 2016-09-19  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r206107.

Modified: trunk/Source/WebCore/page/DOMWindow.h (206108 => 206109)


--- trunk/Source/WebCore/page/DOMWindow.h	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/Source/WebCore/page/DOMWindow.h	2016-09-19 20:35:47 UTC (rev 206109)
@@ -193,8 +193,6 @@
         int screenTop() const { return screenY(); }
         int scrollX() const;
         int scrollY() const;
-        int pageXOffset() const { return scrollX(); }
-        int pageYOffset() const { return scrollY(); }
 
         bool closed() const;
 

Modified: trunk/Source/WebCore/page/DOMWindow.idl (206108 => 206109)


--- trunk/Source/WebCore/page/DOMWindow.idl	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2016-09-19 20:35:47 UTC (rev 206109)
@@ -94,11 +94,12 @@
     [Replaceable] readonly attribute long screenY;
     [Replaceable] readonly attribute long screenLeft;
     [Replaceable] readonly attribute long screenTop;
-    [Replaceable] readonly attribute long scrollX;
-    [Replaceable] readonly attribute long scrollY;
-    readonly attribute long pageXOffset;
-    readonly attribute long pageYOffset;
 
+    [Replaceable] readonly attribute double scrollX;
+    [Replaceable] readonly attribute double scrollY;
+    [Replaceable, ImplementedAs=scrollX] readonly attribute double pageXOffset;
+    [Replaceable, ImplementedAs=scrollY] readonly attribute double pageYOffset;
+
     void scrollBy(unrestricted double x, unrestricted double y);
     void scrollTo(unrestricted double x, unrestricted double y);
     [ImplementedAs=scrollTo] void scroll(unrestricted double x, unrestricted double y);

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp (206108 => 206109)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp	2016-09-19 20:22:16 UTC (rev 206108)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp	2016-09-19 20:35:47 UTC (rev 206109)
@@ -860,7 +860,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_DOM_WINDOW(self), 0);
     WebCore::DOMWindow* item = WebKit::core(self);
-    glong result = item->pageXOffset();
+    glong result = item->scrollX();
     return result;
 }
 
@@ -869,7 +869,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_DOM_WINDOW(self), 0);
     WebCore::DOMWindow* item = WebKit::core(self);
-    glong result = item->pageYOffset();
+    glong result = item->scrollY();
     return result;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to