Title: [105820] trunk
Revision
105820
Author
[email protected]
Date
2012-01-24 15:21:09 -0800 (Tue, 24 Jan 2012)

Log Message

REGRESSION(r103245): can't scroll left/up using scrollbar controls of overflowing elements
https://bugs.webkit.org/show_bug.cgi?id=76317

Reviewed by Darin Adler.

Source/WebCore:

Test: scrollbars/scroll-rtl-or-bt-layer.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Call scrollToOffsetWithoutAnimation since we're always
scrolling to the just computed offset.

LayoutTests:

* platform/win/Skipped:
* scrollbars/scroll-rtl-or-bt-layer-expected.txt: Added.
* scrollbars/scroll-rtl-or-bt-layer.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105819 => 105820)


--- trunk/LayoutTests/ChangeLog	2012-01-24 23:14:32 UTC (rev 105819)
+++ trunk/LayoutTests/ChangeLog	2012-01-24 23:21:09 UTC (rev 105820)
@@ -1,3 +1,14 @@
+2012-01-24  Tony Chang  <[email protected]>
+
+        REGRESSION(r103245): can't scroll left/up using scrollbar controls of overflowing elements
+        https://bugs.webkit.org/show_bug.cgi?id=76317
+
+        Reviewed by Darin Adler.
+
+        * platform/win/Skipped:
+        * scrollbars/scroll-rtl-or-bt-layer-expected.txt: Added.
+        * scrollbars/scroll-rtl-or-bt-layer.html: Added.
+
 2012-01-24  David Levin  <[email protected]>
 
         Change reference of revokeObjectURL in worker-apply-blob-url-to-xhr.html to use webkitURL.

Modified: trunk/LayoutTests/platform/win/Skipped (105819 => 105820)


--- trunk/LayoutTests/platform/win/Skipped	2012-01-24 23:14:32 UTC (rev 105819)
+++ trunk/LayoutTests/platform/win/Skipped	2012-01-24 23:21:09 UTC (rev 105820)
@@ -970,6 +970,7 @@
 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
 scrollbars/scrollevent-iframe-no-scrolling-wheel.html
+scrollbars/scroll-rtl-or-bt-layer.html
 
 # Windows port doesn't yet support rendering of non-BMP characters even though there's a font available.
 fast/text/international/plane2.html 

Added: trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer-expected.txt (0 => 105820)


--- trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer-expected.txt	2012-01-24 23:21:09 UTC (rev 105820)
@@ -0,0 +1,5 @@
+This test requires DumpRenderTree. To test manually, try to scroll the blue div to the left and the red div up using the scrollbar arrows or the mouse wheel. The test passes if the divs scroll.
+
+rtl: PASS
+bt: PASS
+

Added: trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer.html (0 => 105820)


--- trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer.html	                        (rev 0)
+++ trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer.html	2012-01-24 23:21:09 UTC (rev 105820)
@@ -0,0 +1,83 @@
+<html>
+<body>
+
+<p>This test requires DumpRenderTree.  To test manually, try to scroll the
+blue div to the left and the red div up using the scrollbar arrows or the
+mouse wheel.  The test passes if the divs scroll.</p>
+
+<div id='rtl' style="direction: rtl; width: 100px; overflow: auto; border: 1px solid blue;">
+01234567890123456789
+</div>
+
+<div id='bt' style="-webkit-writing-mode: horizontal-bt; height: 100px; overflow: auto; border: 1 px solid red;">
+aaa<br>
+bbb<br>
+ccc<br>
+ddd<br>
+eee<br>
+fff<br>
+ggg<br>
+hhh<br>
+iii<br>
+jjj<br>
+kkk
+</div>
+
+<div id="console"></div>
+
+<script>
+function log(message)
+{
+    document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function centerMouseOn(elementId)
+{
+    var element = document.getElementById(elementId);
+    eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth / 2,
+        element.offsetTop + element.offsetHeight / 2);
+}
+
+function test()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    if (!window.eventSender || !window.eventSender.mouseScrollBy) {
+        log("This test requires DumpRenderTree with eventSender.mouseScrollBy.");
+        return;
+    }
+
+    centerMouseOn("rtl");
+    var offsetBefore = document.getElementById("rtl").scrollLeft;
+    eventSender.mouseScrollBy(1, 0);
+    var offsetAfter = document.getElementById("rtl").scrollLeft;
+    if (offsetBefore > offsetAfter)
+        log("rtl: PASS");
+    else {
+        log("rtl: FAIL");
+        log("scrollLeft before: " + offsetBefore);
+        log("scrollLeft after: " + offsetAfter);
+    }
+
+    centerMouseOn("bt");
+    offsetBefore = document.getElementById("bt").scrollTop;
+    eventSender.mouseScrollBy(0, 1);
+    offsetAfter = document.getElementById("bt").scrollTop;
+    if (offsetBefore > offsetAfter)
+        log("bt: PASS");
+    else {
+        log("bt: FAIL");
+        log("scrollTop before: " + offsetBefore);
+        log("scrollTop after: " + offsetAfter);
+    }
+
+    document.body.removeChild(document.getElementById("rtl"));
+    document.body.removeChild(document.getElementById("bt"));
+}
+
+test();
+</script>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (105819 => 105820)


--- trunk/Source/WebCore/ChangeLog	2012-01-24 23:14:32 UTC (rev 105819)
+++ trunk/Source/WebCore/ChangeLog	2012-01-24 23:21:09 UTC (rev 105820)
@@ -1,3 +1,16 @@
+2012-01-24  Tony Chang  <[email protected]>
+
+        REGRESSION(r103245): can't scroll left/up using scrollbar controls of overflowing elements
+        https://bugs.webkit.org/show_bug.cgi?id=76317
+
+        Reviewed by Darin Adler.
+
+        Test: scrollbars/scroll-rtl-or-bt-layer.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout): Call scrollToOffsetWithoutAnimation since we're always
+        scrolling to the just computed offset.
+
 2012-01-24  Mark Rowe  <[email protected]>
 
         Fix all of the builds after r105812.

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (105819 => 105820)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-01-24 23:14:32 UTC (rev 105819)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-01-24 23:21:09 UTC (rev 105820)
@@ -2292,6 +2292,7 @@
         return;
 
     m_scrollDimensionsDirty = true;
+    IntSize scrollOffsetOriginal(scrollXOffset(), scrollYOffset());
 
     bool horizontalOverflow, verticalOverflow;
     computeScrollDimensions(&horizontalOverflow, &verticalOverflow);
@@ -2374,9 +2375,10 @@
         m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_vBar->setProportion(clientHeight, m_scrollSize.height());
     }
- 
-    scrollToOffset(scrollXOffset(), scrollYOffset());
 
+    if (scrollOffsetOriginal != scrollOffset())
+        scrollToOffsetWithoutAnimation(LayoutPoint(scrollXOffset(), scrollYOffset()));
+
     if (renderer()->node() && renderer()->document()->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
         updateOverflowStatus(horizontalOverflow, verticalOverflow);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to