Title: [194486] trunk
Revision
194486
Author
[email protected]
Date
2016-01-01 20:44:16 -0800 (Fri, 01 Jan 2016)

Log Message

REGRESSION (r194448): Scrolling overflow:scroll goes too far
https://bugs.webkit.org/show_bug.cgi?id=152645

Reviewed by Zalan Bujtas.

Source/WebCore:

Fix a bug introduced in r194448: use the scrollPosition, not the scrollOrigin
to compute the overhang amount.

Test: fast/scrolling/overflow-scroll-past-max.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::overhangAmount):

LayoutTests:

Test that scrolls and overflow div with wheel events, then checks that it has
not passed the max scroll offset.

* fast/scrolling/overflow-scroll-past-max-expected.txt: Added.
* fast/scrolling/overflow-scroll-past-max.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (194485 => 194486)


--- trunk/LayoutTests/ChangeLog	2016-01-02 02:41:01 UTC (rev 194485)
+++ trunk/LayoutTests/ChangeLog	2016-01-02 04:44:16 UTC (rev 194486)
@@ -1,3 +1,16 @@
+2016-01-01  Simon Fraser  <[email protected]>
+
+        REGRESSION (r194448): Scrolling overflow:scroll goes too far
+        https://bugs.webkit.org/show_bug.cgi?id=152645
+
+        Reviewed by Zalan Bujtas.
+        
+        Test that scrolls and overflow div with wheel events, then checks that it has
+        not passed the max scroll offset.
+
+        * fast/scrolling/overflow-scroll-past-max-expected.txt: Added.
+        * fast/scrolling/overflow-scroll-past-max.html: Added.
+
 2016-01-01  Michael Catanzaro  <[email protected]>
 
         [GTK] Several IndexedDB tests failing

Added: trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max-expected.txt (0 => 194486)


--- trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max-expected.txt	2016-01-02 04:44:16 UTC (rev 194486)
@@ -0,0 +1 @@
+PASS: scrollTop was 300

Added: trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max.html (0 => 194486)


--- trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/overflow-scroll-past-max.html	2016-01-02 04:44:16 UTC (rev 194486)
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        #scrolling {
+            height: 300px;
+            width: 300px;
+            border: 1px solid black;
+            overflow-y: scroll;
+        }
+        
+        .content {
+            height: 600px;
+            width: 100%;
+            background-image: linear-gradient(silver, gray);
+        }
+    </style>
+    <script>
+        function checkForScroll()
+        {
+            var scroller = document.getElementById("scrolling");
+            var expectedScrollTop = 300;
+            
+            if (scroller.scrollTop == expectedScrollTop)
+                document.getElementById('result').textContent = "PASS: scrollTop was " + expectedScrollTop;
+            else
+                document.getElementById('result').textContent = "FAIL: scrollTop was " + scroller.scrollTop;
+
+            testRunner.notifyDone();
+        }
+        
+        function scrollTest()
+        {
+            eventSender.mouseMoveTo(20, 20);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "began", "none");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "begin");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end");
+            eventSender.callAfterScrollingCompletes(checkForScroll);
+        }
+
+        function startTest()
+        {
+            if (window.eventSender) {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+
+                eventSender.monitorWheelEvents();
+                setTimeout(scrollTest, 0);
+            }
+        }
+        
+        window.addEventListener('load', startTest, false);
+    </script>
+</head>
+<body>
+<div id="scrolling">
+    <div class="content"></div>
+</div>
+<div id="result"></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (194485 => 194486)


--- trunk/Source/WebCore/ChangeLog	2016-01-02 02:41:01 UTC (rev 194485)
+++ trunk/Source/WebCore/ChangeLog	2016-01-02 04:44:16 UTC (rev 194486)
@@ -1,3 +1,18 @@
+2016-01-01  Simon Fraser  <[email protected]>
+
+        REGRESSION (r194448): Scrolling overflow:scroll goes too far
+        https://bugs.webkit.org/show_bug.cgi?id=152645
+
+        Reviewed by Zalan Bujtas.
+        
+        Fix a bug introduced in r194448: use the scrollPosition, not the scrollOrigin
+        to compute the overhang amount.
+
+        Test: fast/scrolling/overflow-scroll-past-max.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::overhangAmount):
+
 2015-12-22  Brent Fulgham  <[email protected]>
 
         [WebGL] Blacklisted OpenGL contexts are not safe to use

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (194485 => 194486)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-01-02 02:41:01 UTC (rev 194485)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-01-02 04:44:16 UTC (rev 194486)
@@ -2757,7 +2757,7 @@
     IntSize stretch;
 
     // FIXME: use maximumScrollOffset()
-    ScrollOffset scrollOffset = scrollOffsetFromPosition(scrollOrigin());
+    ScrollOffset scrollOffset = scrollOffsetFromPosition(scrollPosition());
     if (scrollOffset.y() < 0)
         stretch.setHeight(scrollOffset.y());
     else if (scrollableContentsSize().height() && scrollOffset.y() > scrollableContentsSize().height() - visibleHeight())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to