REGRESSION (r158254): Rubber-banding at Bing image search causes the toolbar to move...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Mar 2014 13:28:03 +0000 (13:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Mar 2014 13:28:03 +0000 (13:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128873

Patch by Gurpreet Kaur <k.gurpreet@samsung.com> on 2014-03-06
Reviewed by Antonio Gomes.

Source/WebCore:

This regression is caused by  http://trac.webkit.org/changeset/154614
and http://trac.webkit.org/changeset/156605. So reverting the changes
to make it Web compatible as earlier.

* dom/Element.cpp:
(WebCore::Element::scrollLeft):
(WebCore::Element::scrollTop):
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
Reverting changes as it caused regression.

LayoutTests:

* fast/css/zoom-body-scroll-expected.txt:
* fast/css/zoom-body-scroll.html:
* fast/dom/Element/documentElement-scrollLeft-expected.txt:
* fast/dom/Element/documentElement-scrollLeft.html:
* fast/dom/Element/documentElement-scrollTop-expected.txt:
* fast/dom/Element/documentElement-scrollTop.html:
* fast/dom/Element/scrollLeft-expected.txt:
* fast/dom/Element/scrollLeft.html:
* fast/dom/Element/scrollTop-expected.txt:
* fast/dom/Element/scrollTop.html:
* fast/events/mouse-cursor.html:
* fast/multicol/scrolling-overflow.html:
* http/tests/navigation/anchor-frames-expected.txt:
* http/tests/navigation/anchor-frames-gbk-expected.txt:
* http/tests/navigation/resources/frame-with-anchor-gbk.html:
* http/tests/navigation/resources/frame-with-anchor-same-origin.html:
* http/tests/navigation/resources/frame-with-anchor.html:
* platform/mac-wk2/tiled-drawing/resources/scroll-and-load-page.html:
* platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
Reverting changes as it caused regression.

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

22 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/zoom-body-scroll-expected.txt
LayoutTests/fast/css/zoom-body-scroll.html
LayoutTests/fast/dom/Element/documentElement-scrollLeft-expected.txt
LayoutTests/fast/dom/Element/documentElement-scrollLeft.html
LayoutTests/fast/dom/Element/documentElement-scrollTop-expected.txt
LayoutTests/fast/dom/Element/documentElement-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
LayoutTests/fast/events/mouse-cursor.html
LayoutTests/fast/multicol/scrolling-overflow.html
LayoutTests/http/tests/navigation/anchor-frames-expected.txt
LayoutTests/http/tests/navigation/anchor-frames-gbk-expected.txt
LayoutTests/http/tests/navigation/resources/frame-with-anchor-gbk.html
LayoutTests/http/tests/navigation/resources/frame-with-anchor-same-origin.html
LayoutTests/http/tests/navigation/resources/frame-with-anchor.html
LayoutTests/platform/mac-wk2/tiled-drawing/resources/scroll-and-load-page.html
LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp

index c8be45a2acf0fa89556380eee41eb2f0337b8775..849a4c754f94a5bbb7f979a6f986f8be4cf65cfc 100644 (file)
@@ -1,3 +1,31 @@
+2014-03-06  Gurpreet Kaur  <k.gurpreet@samsung.com>
+
+        REGRESSION (r158254): Rubber-banding at Bing image search causes the toolbar to move up and away
+        https://bugs.webkit.org/show_bug.cgi?id=128873
+
+        Reviewed by Antonio Gomes.
+
+        * fast/css/zoom-body-scroll-expected.txt:
+        * fast/css/zoom-body-scroll.html:
+        * fast/dom/Element/documentElement-scrollLeft-expected.txt:
+        * fast/dom/Element/documentElement-scrollLeft.html:
+        * fast/dom/Element/documentElement-scrollTop-expected.txt:
+        * fast/dom/Element/documentElement-scrollTop.html:
+        * fast/dom/Element/scrollLeft-expected.txt:
+        * fast/dom/Element/scrollLeft.html:
+        * fast/dom/Element/scrollTop-expected.txt:
+        * fast/dom/Element/scrollTop.html:
+        * fast/events/mouse-cursor.html:
+        * fast/multicol/scrolling-overflow.html:
+        * http/tests/navigation/anchor-frames-expected.txt:
+        * http/tests/navigation/anchor-frames-gbk-expected.txt:
+        * http/tests/navigation/resources/frame-with-anchor-gbk.html:
+        * http/tests/navigation/resources/frame-with-anchor-same-origin.html:
+        * http/tests/navigation/resources/frame-with-anchor.html:
+        * platform/mac-wk2/tiled-drawing/resources/scroll-and-load-page.html:
+        * platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
+        Reverting changes as it caused regression.
+
 2014-03-05  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         Unreviewed EFL gardening.
index f960e57b68f993b6c0ddf3961dd2c2298a0809b4..7403b56a4807d510ee1a2956f64841f8e9647b52 100644 (file)
@@ -9,7 +9,7 @@ scrollLeft: 50
 Zooming in
 scrollHeight: 1000
 scrollWidth: 1000
-scrollTop: 100
+scrollTop: 0
 scrollLeft: 50
 
 Scrolling down to 100
index 1a180d2e2b473044a3ad57619f88ecf8b8b383a0..bfc98c9506b4720b3f8efa8b5e9f9b49dc7d6a19 100644 (file)
@@ -1,5 +1,5 @@
 <html>
-<body onload="bodyScroll()">
+<body>
     <div style="width: 1000px; height: 1000px; position: absolute; top: 0; left: 0;"></div>
     <div style="width: 100px; height: 100px; position: absolute; top: 100px; left: 0; background: green"></div>
     <p>
             console.appendChild(document.createTextNode(message + "\n"));
         }
 
-        function bodyScroll() {
-            if (window.testRunner) {
-                testRunner.dumpAsText();
-                var body = document.body;
-                window.scrollTo(50,100);
-                log("scrollHeight: " + body.scrollHeight);
-                log("scrollWidth: " + body.scrollWidth);
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            var body = document.body;
+            log("scrollHeight: " + body.scrollHeight);
+            log("scrollWidth: " + body.scrollWidth);
 
-                log("\nScrolling right to 50");
-                body.scrollLeft = 50;
-                log("scrollLeft: " + body.scrollLeft);
+            log("\nScrolling right to 50");
+            body.scrollLeft = 50;
+            log("scrollLeft: " + body.scrollLeft);
 
-                log("\nZooming in");
-                eventSender.zoomPageIn();
-                log("scrollHeight: " + body.scrollHeight);
-                log("scrollWidth: " + body.scrollWidth);
-                log("scrollTop: " + body.scrollTop);
-                log("scrollLeft: " + body.scrollLeft);
+            log("\nZooming in");
+            eventSender.zoomPageIn();
+            log("scrollHeight: " + body.scrollHeight);
+            log("scrollWidth: " + body.scrollWidth);
+            log("scrollTop: " + body.scrollTop);
+            log("scrollLeft: " + body.scrollLeft);
 
-                log("\nScrolling down to 100");
-                body.scrollTop = 100;
-                log("scrollTop: " + body.scrollTop);
+            log("\nScrolling down to 100");
+            body.scrollTop = 100;
+            log("scrollTop: " + body.scrollTop);
 
-                log("\nZooming back out");
-                eventSender.zoomPageOut();
-                log("scrollTop: " + body.scrollTop);
-                log("scrollLeft: " + body.scrollLeft);
-                       }
-        }
+            log("\nZooming back out");
+            eventSender.zoomPageOut();
+            log("scrollTop: " + body.scrollTop);
+            log("scrollLeft: " + body.scrollLeft);
+           }      
     </script>
 </body>
 </html>
index 8fcd8f716f57cea3939daf2a4de570ca310dc6e3..1dacc16a6fd813ad61fdd8afddd5722889299f61 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.documentElement.scrollLeft is 500
+PASS document.documentElement.scrollLeft is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 40f8dc129f4c258e569453c4b23da138f58e8571..12396926ea4ad228c99eba143404e552ebd8a793 100755 (executable)
@@ -13,7 +13,7 @@
                 description('Tests that for standard mode document.documentElement.scrollLeft returns the scroll left value');
 
                 document.documentElement.scrollLeft = 500;
-                shouldBe("document.documentElement.scrollLeft","500");
+                shouldBe("document.documentElement.scrollLeft","0");
                 isSuccessfullyParsed();
             }
         </script>
index 671d84bdbb7394e5454cdc39a4d058f4923b5d56..664e7ae65e0dbdcf23b73b376f0d3a6cb2c5cccf 100755 (executable)
@@ -3,7 +3,7 @@ Tests that for standard mode document.documentElement.scrollTop returns the scro
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.documentElement.scrollTop is 500
+PASS document.documentElement.scrollTop is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 03adca5ccacf38940b26bdc00234143cd29b24f6..fcfeadec9bfc1f70f9797add100ec7883de120bc 100755 (executable)
@@ -13,7 +13,7 @@
                 description('Tests that for standard mode document.documentElement.scrollTop returns the scroll top value');
 
                 document.documentElement.scrollTop = 500;
-                shouldBe("document.documentElement.scrollTop","500");
+                shouldBe("document.documentElement.scrollTop","0");
                 isSuccessfullyParsed();
             }
         </script>
index 4ef8a91bb8f564d9d9a4aba15ca31f487b7168f0..99bc52c8329edc40679182ad6f8e1d29ec5767ae 100755 (executable)
@@ -5,7 +5,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 500
-PASS document.documentElement.scrollLeft is 500
+PASS document.documentElement.scrollLeft is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 72a93786be17b4e1be179b09b944d55f4d6b4db7..f8d39bd9eaae268a392e38ff009b3b637476a8cd 100755 (executable)
@@ -16,7 +16,7 @@
                     window.scrollTo(500,0);\r
                     shouldBe("window.pageXOffset","500");\r
                     shouldBe("document.body.scrollLeft","500");\r
-                    shouldBe("document.documentElement.scrollLeft","500");\r
+                    shouldBe("document.documentElement.scrollLeft","0");\r
                     finishJSTest();\r
                 }, 0);\r
             }\r
index 3edaa472fb2e117b7cc8261b90e73e5be6e5a7f9..0f7716c5ba420689e62b0000287310ef13a5c272 100755 (executable)
@@ -5,7 +5,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 500
-PASS document.documentElement.scrollTop is 500
+PASS document.documentElement.scrollTop is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index f8a53b8787669849da19d1909b7ea4267ad01501..0a5631a78f92e409fe6a9afd4b33771b028b0b94 100755 (executable)
@@ -16,7 +16,7 @@
                     window.scrollTo(0,500);\r
                     shouldBe("window.pageYOffset","500");\r
                     shouldBe("document.body.scrollTop","500");\r
-                    shouldBe("document.documentElement.scrollTop","500");\r
+                    shouldBe("document.documentElement.scrollTop","0");\r
                     finishJSTest();\r
                 }, 0);\r
             }\r
index 6cfc859f82f8e8f233770a49eec3f137174161bb..2e5259bf564a8fb215266e6bb0c05984b9c270ed 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html>
 <head>
 <script src="../../resources/js-test-pre.js"></script>
index 27ef618fa369e3450953f9f6b1dfabeed9b1d2b2..bcc37ce05b1a6fbfddca9167f7c0dbd72fc818aa 100644 (file)
@@ -14,9 +14,9 @@
     <script>
     function doTest()
     {
-        document.documentElement.offsetLeft;
-        document.documentElement.scrollLeft = 100;
-        document.documentElement.offsetLeft;
+        document.body.offsetLeft;
+        document.body.scrollLeft = 100;
+        document.body.offsetLeft;
     }
     </script>
   </head>
index c6561d8917c7472382029645a3d414c4f6153f6e..fa041349cd43a18f1d7c223744ba9c58e9f7f494 100644 (file)
@@ -8,7 +8,7 @@ Tests that loading a frame with a URL that contains a fragment pointed at a name
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.body.offsetHeight > window.innerHeight is true
+PASS document.body.offsetHeight > document.documentElement.clientHeight is true
 PASS document.body.scrollTop > 0 is true
 PASS document.body.scrollTop + document.documentElement.clientHeight > 2000 is true
 PASS successfullyParsed is true
index 42daf7731315140ac15d2064f08a2af3b7fbab9a..de5dd0c1b1735a280c88730e6e0c466735684837 100644 (file)
@@ -8,7 +8,7 @@ Tests that loading a frame with a URL that contains a fragment pointed at a name
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.body.offsetHeight > window.innerHeight is true
+PASS document.body.offsetHeight > document.documentElement.clientHeight is true
 PASS document.body.scrollTop > 0 is true
 PASS document.body.scrollTop + document.documentElement.clientHeight > 2000 is true
 PASS successfullyParsed is true
index 42d50e4a9ceb30d5ba8491ff3ed7255c391fb8bf..a1bdb89e411220338a16e0553a6b00c8bcf1c2b0 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
@@ -11,7 +12,7 @@
       setTimeout(function() {
           // Make sure that the body is taller than the viewport (i.e. scrolling is
           // required).
-          shouldBeTrue('document.body.offsetHeight > window.innerHeight');
+          shouldBeTrue('document.body.offsetHeight > document.documentElement.clientHeight');
           
           // We should be scrolled at least a little bit
           shouldBeTrue('document.body.scrollTop > 0');
index 1db5ec5ec6c2213c661cec4b6d63878a981c2eeb..7adf9b1749c74d15d53dcae97f5a0da2ecd49d93 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html>
 <head>
   <script src="../../../js-test-resources/js-test-pre.js"></script>
index c494e7cf52afde8706a7dd28b192c9a250d089e0..09f3a703364966868b62b3c734cb56e7ad77c50a 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html>
 <head>
   <script src="../../../js-test-resources/js-test-pre.js"></script>
@@ -10,7 +11,7 @@
       setTimeout(function() {
           // Make sure that the body is taller than the viewport (i.e. scrolling is
           // required).
-          shouldBeTrue('document.body.offsetHeight > window.innerHeight');
+          shouldBeTrue('document.body.offsetHeight > document.documentElement.clientHeight');
 
           // We should be scrolled at least a little bit
           shouldBeTrue('document.body.scrollTop > 0');
index 526d1f1c9a6e65aee55a8d8ba1f25bb6f4ee705b..46141f3d62562cf716ad10ad8325453f14578c48 100644 (file)
@@ -1,3 +1,21 @@
+2014-03-06  Gurpreet Kaur  <k.gurpreet@samsung.com>
+
+        REGRESSION (r158254): Rubber-banding at Bing image search causes the toolbar to move up and away
+        https://bugs.webkit.org/show_bug.cgi?id=128873
+
+        Reviewed by Antonio Gomes.
+
+        This regression is caused by  http://trac.webkit.org/changeset/154614 
+        and http://trac.webkit.org/changeset/156605. So reverting the changes
+        to make it Web compatible as earlier.
+
+        * dom/Element.cpp:
+        (WebCore::Element::scrollLeft):
+        (WebCore::Element::scrollTop):
+        (WebCore::Element::setScrollLeft):
+        (WebCore::Element::setScrollTop):
+        Reverting changes as it caused regression.
+
 2014-03-06  Zan Dobersek  <zdobersek@igalia.com>
 
         Move Source/WebCore/html/canvas/ code to std::unique_ptr
index 5c56d6e437212059f43db92a950a55df5c6feddc..1a41695ce7c0b31103e51f2fe23573854d90e03d 100644 (file)
@@ -784,18 +784,8 @@ int Element::clientHeight()
 
 int Element::scrollLeft()
 {
-    if (document().documentElement() == this && document().inQuirksMode())
-        return 0;
-
     document().updateLayoutIgnorePendingStylesheets();
 
-    if (!document().hasLivingRenderTree())
-        return 0;
-    RenderView& renderView = *document().renderView();
-
-    if (document().documentElement() == this)
-        return adjustForAbsoluteZoom(renderView.frameView().scrollX(), renderView);
-
     if (RenderBox* rend = renderBox())
         return adjustForAbsoluteZoom(rend->scrollLeft(), *rend);
     return 0;
@@ -803,18 +793,8 @@ int Element::scrollLeft()
 
 int Element::scrollTop()
 {
-    if (document().documentElement() == this && document().inQuirksMode())
-        return 0;
-
     document().updateLayoutIgnorePendingStylesheets();
 
-    if (!document().hasLivingRenderTree())
-        return 0;
-    RenderView& renderView = *document().renderView();
-
-    if (document().documentElement() == this)
-        return adjustForAbsoluteZoom(renderView.frameView().scrollY(), renderView);
-
     if (RenderBox* rend = renderBox())
         return adjustForAbsoluteZoom(rend->scrollTop(), *rend);
     return 0;
@@ -822,42 +802,16 @@ int Element::scrollTop()
 
 void Element::setScrollLeft(int newLeft)
 {
-    if (document().documentElement() == this && document().inQuirksMode())
-        return;
-
     document().updateLayoutIgnorePendingStylesheets();
 
-    if (!document().hasLivingRenderTree())
-        return;
-
-    if (document().documentElement() == this) {
-        RenderView& renderView = *document().renderView();
-        int zoom = renderView.style().effectiveZoom();
-        renderView.frameView().setScrollPosition(IntPoint(newLeft * zoom, renderView.frameView().scrollY() * zoom));
-        return;
-    }
-
     if (RenderBox* rend = renderBox())
         rend->setScrollLeft(static_cast<int>(newLeft * rend->style().effectiveZoom()));
 }
 
 void Element::setScrollTop(int newTop)
 {
-    if (document().documentElement() == this && document().inQuirksMode())
-        return;
-
     document().updateLayoutIgnorePendingStylesheets();
 
-    if (!document().hasLivingRenderTree())
-        return;
-
-    if (document().documentElement() == this) {
-        RenderView& renderView = *document().renderView();
-        int zoom = renderView.style().effectiveZoom();
-        renderView.frameView().setScrollPosition(IntPoint(renderView.frameView().scrollX() * zoom, newTop * zoom));
-        return;
-    }
-
     if (RenderBox* rend = renderBox())
         rend->setScrollTop(static_cast<int>(newTop * rend->style().effectiveZoom()));
 }