REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2013 05:39:37 +0000 (05:39 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2013 05:39:37 +0000 (05:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122882

Reviewed by Anders Carlsson.

Source/WebCore:

scrollLeft and scrollTop have to continue to function in the strict mode for the Web compatiblity.
In particular, www.facebook.com and build.webkit.org depend on this behavior as of October 29th, 2013.

* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):

LayoutTests:

* fast/dom/Element/body-scrollLeft-expected.txt:
* fast/dom/Element/body-scrollLeft.html:
* fast/dom/Element/body-scrollTop-expected.txt:
* fast/dom/Element/body-scrollTop.html:
* fast/dom/Element/scrollLeft-expected.txt:
* fast/dom/Element/scrollLeft.html:
* fast/dom/Element/scrollTop-expected.txt:
* fast/dom/Element/scrollTop.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/Element/body-scrollLeft-expected.txt
LayoutTests/fast/dom/Element/body-scrollLeft.html
LayoutTests/fast/dom/Element/body-scrollTop-expected.txt
LayoutTests/fast/dom/Element/body-scrollTop.html
LayoutTests/fast/dom/Element/scrollLeft-expected.txt
LayoutTests/fast/dom/Element/scrollLeft.html
LayoutTests/fast/dom/Element/scrollTop-expected.txt
LayoutTests/fast/dom/Element/scrollTop.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLBodyElement.cpp

index 54098a2..a7fe0f9 100644 (file)
@@ -1,5 +1,21 @@
 2013-10-29  Ryosuke Niwa  <rniwa@webkit.org>
 
+        REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position
+        https://bugs.webkit.org/show_bug.cgi?id=122882
+
+        Reviewed by Anders Carlsson.
+
+        * fast/dom/Element/body-scrollLeft-expected.txt:
+        * fast/dom/Element/body-scrollLeft.html:
+        * fast/dom/Element/body-scrollTop-expected.txt:
+        * fast/dom/Element/body-scrollTop.html:
+        * fast/dom/Element/scrollLeft-expected.txt:
+        * fast/dom/Element/scrollLeft.html:
+        * fast/dom/Element/scrollTop-expected.txt:
+        * fast/dom/Element/scrollTop.html:
+
+2013-10-29  Ryosuke Niwa  <rniwa@webkit.org>
+
         Update Mavericks test expectation, tracked by bugs 123489 and 123490.
 
         * platform/mac/TestExpectations:
index 98e6898..cfae951 100755 (executable)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS document.body.scrollLeft is 0
+PASS document.body.scrollLeft is 500
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 8a457b3..a7174bb 100755 (executable)
@@ -13,7 +13,7 @@
                 description('Tests that for non-standard mode document.body.scrollLeft returns the scroll left value as 0');
 
                 document.body.scrollLeft = 500;
-                shouldBe("document.body.scrollLeft","0");
+                shouldBe("document.body.scrollLeft","500");
                 isSuccessfullyParsed();
                        }
         </script>
index 9849308..3b23a4b 100755 (executable)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS document.body.scrollTop is 0
+PASS document.body.scrollTop is 500
 PASS successfullyParsed is true
 
 TEST COMPLETE
index d1a194d..aa35737 100755 (executable)
@@ -13,7 +13,7 @@
                 description('Tests that for non-standard mode document.body.scrollTop returns the scroll top value as 0');
 
                 document.body.scrollTop = 500;
-                shouldBe("document.body.scrollTop","0");
+                shouldBe("document.body.scrollTop","500");
                                isSuccessfullyParsed();
             }
         </script>
index 0a23454..4ef8a91 100755 (executable)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS window.pageXOffset is 500
-PASS document.body.scrollLeft is 0
+PASS document.body.scrollLeft is 500
 PASS document.documentElement.scrollLeft is 500
 PASS successfullyParsed is true
 
index 4d9d68e..72a9378 100755 (executable)
@@ -15,7 +15,7 @@
                 setTimeout(function() {\r
                     window.scrollTo(500,0);\r
                     shouldBe("window.pageXOffset","500");\r
-                    shouldBe("document.body.scrollLeft","0");\r
+                    shouldBe("document.body.scrollLeft","500");\r
                     shouldBe("document.documentElement.scrollLeft","500");\r
                     finishJSTest();\r
                 }, 0);\r
index 405aed5..3edaa47 100755 (executable)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS window.pageYOffset is 500
-PASS document.body.scrollTop is 0
+PASS document.body.scrollTop is 500
 PASS document.documentElement.scrollTop is 500
 PASS successfullyParsed is true
 
index f0e5c37..f8a53b8 100755 (executable)
@@ -15,7 +15,7 @@
                 setTimeout(function() {\r
                     window.scrollTo(0,500);\r
                     shouldBe("window.pageYOffset","500");\r
-                    shouldBe("document.body.scrollTop","0");\r
+                    shouldBe("document.body.scrollTop","500");\r
                     shouldBe("document.documentElement.scrollTop","500");\r
                     finishJSTest();\r
                 }, 0);\r
index 5a84f1d..2265fdb 100644 (file)
@@ -1,3 +1,19 @@
+2013-10-29  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position
+        https://bugs.webkit.org/show_bug.cgi?id=122882
+
+        Reviewed by Anders Carlsson.
+
+        scrollLeft and scrollTop have to continue to function in the strict mode for the Web compatiblity.
+        In particular, www.facebook.com and build.webkit.org depend on this behavior as of October 29th, 2013.
+
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::scrollLeft):
+        (WebCore::HTMLBodyElement::setScrollLeft):
+        (WebCore::HTMLBodyElement::scrollTop):
+        (WebCore::HTMLBodyElement::setScrollTop):
+
 2013-10-29  Brady Eidson  <beidson@apple.com>
 
         IDBTransactionBackend should be cross platform
index db87ce6..eee726b 100644 (file)
@@ -251,8 +251,6 @@ static int adjustForZoom(int value, Frame& frame)
 
 int HTMLBodyElement::scrollLeft()
 {
-    if (!document().inQuirksMode())
-        return 0;
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
     if (!frame)
@@ -265,9 +263,6 @@ int HTMLBodyElement::scrollLeft()
 
 void HTMLBodyElement::setScrollLeft(int scrollLeft)
 {
-    if (!document().inQuirksMode())
-        return;
-
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
     if (!frame)
@@ -280,8 +275,6 @@ void HTMLBodyElement::setScrollLeft(int scrollLeft)
 
 int HTMLBodyElement::scrollTop()
 {
-    if (!document().inQuirksMode())
-        return 0;
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
     if (!frame)
@@ -294,9 +287,6 @@ int HTMLBodyElement::scrollTop()
 
 void HTMLBodyElement::setScrollTop(int scrollTop)
 {
-    if (!document().inQuirksMode())
-        return;
-
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
     if (!frame)