Unreviewed, rolling out r156257.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 06:31:24 +0000 (06:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 06:31:24 +0000 (06:31 +0000)
http://trac.webkit.org/changeset/156257
https://bugs.webkit.org/show_bug.cgi?id=121777

The test from this patch fails (Requested by ap on #webkit).

Source/WebCore:

* rendering/RenderBox.cpp:
(WebCore::RenderBox::calculateAutoscrollDirection):

LayoutTests:

* fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt: Removed.
* fast/events/drag-and-drop-autoscroll-inner-frame.html: Removed.

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

LayoutTests/ChangeLog
LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt [deleted file]
LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp

index a85312006a94145ffc30a36797f2d3fb2f1d12bf..7ad59556f6d61c3de6ef5bac50856c1805e3f56e 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-22  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r156257.
+        http://trac.webkit.org/changeset/156257
+        https://bugs.webkit.org/show_bug.cgi?id=121777
+
+        The test from this patch fails (Requested by ap on #webkit).
+
+        * fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt: Removed.
+        * fast/events/drag-and-drop-autoscroll-inner-frame.html: Removed.
+
 2013-09-22  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         Unreviewed EFL gardening. Rebaselining after r156040.
diff --git a/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt b/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt
deleted file mode 100644 (file)
index c69721b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-For manual testing, drag and drop "Drop Me" downwards and then upwards. 
-Check autoscroll within an inner frame by drag-and-drop
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Autoscroll should have scrolled the iframe downwards, and did.
-PASS iframe.contentDocument.body.scrollTop < middleTermScrollOffset is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html b/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html
deleted file mode 100644 (file)
index 74844a4..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html>
-<head>
-<style type="text/css">
-#scrollable {
-    height: 200px;
-    overflow: auto;
-    border: solid 3px #cc0000;
-    font-size: 80px;
-}
-</style>
-<script>
-
-var x, y, middleTermScrollOffset;
-var iframe, iframeDocument, draggable;
-
-function log(msg)
-{
-    document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
-}
-
-function setUpTest()
-{
-    if (!window.eventSender) {
-        log('Please run within DumpRenderTree');
-        return;
-    }
-
-    window.internals.settings.setAutoscrollForDragAndDropEnabled(true);
-    window.jsTestIsAsync = true;
-    setTimeout(testIt, 0);
-}
-
-function testIt()
-{
-    eventSender.dragMode = false;
-
-    iframe = document.getElementById('scrollable');
-    iframeDocument = iframe.contentDocument;
-    draggable = iframeDocument.getElementById('draggable');
-
-    iframeDocument.addEventListener("scroll", recordScroll);
-
-    // Grab draggable.
-    x = iframe.offsetLeft + draggable.offsetLeft + 7;
-    y = iframe.offsetTop + draggable.offsetTop + 7;
-
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-
-    // Move mouse to the bottom autoscroll border belt.
-    y = iframe.offsetTop + iframe.offsetHeight - 10;
-    eventSender.mouseMoveTo(x, y);
-}
-
-function recordScroll(e)
-{
-    autoscrollTestPart1();
-    iframeDocument.removeEventListener("scroll", recordScroll);
-}
-
-function recordScroll2(e)
-{
-    autoscrollTestPart2();
-    iframeDocument.removeEventListener("scroll", recordScroll);
-}
-
-function autoscrollTestPart1()
-{
-    if (iframe.contentDocument.body.scrollTop == 0) {
-        testFailed("Autoscroll should have scrolled the iframe downwards, but did not");
-        finishTest();
-        return;
-    }
-
-    testPassed("Autoscroll should have scrolled the iframe downwards, and did.");
-
-    middleTermScrollOffset = iframe.contentDocument.body.scrollTop;
-    iframeDocument.addEventListener("scroll", recordScroll2);
-
-    // Move mouse to the upper autoscroll border belt.
-    y = iframe.offsetTop + 10;
-    eventSender.mouseMoveTo(x, y);
-}
-
-function autoscrollTestPart2()
-{
-    shouldBeTrue("iframe.contentDocument.body.scrollTop < middleTermScrollOffset")
-    finishTest();
-}
-
-function finishTest()
-{
-    eventSender.mouseUp();
-    finishJSTest();
-}
-
-var successfullyParsed = true;
-</script>
-</head>
-<body>
-For manual testing, drag and drop "Drop Me" downwards and then upwards.
-<iframe id="scrollable" src="data:text/html,
-<p id='draggable' draggable='true' style='cursor: hand;'>
-    <b>Drag me!</b>
-</p>
-Try to drag and drop the text above in the input element at the bottom of this iframe. It should scroll. Then, try the way back.
-<br><br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br><input>
-"></iframe><br>
-</div>
-<div id="console"></div>
-<script src="../../resources/js-test-pre.js"></script>
-<script>
-description('Check autoscroll within an inner frame by drag-and-drop');
-setUpTest();
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
index 979860804045d1b6f45020556dca15d289411449..35459383829755b9be2bd5644a6bb23fe8fec623 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-22  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r156257.
+        http://trac.webkit.org/changeset/156257
+        https://bugs.webkit.org/show_bug.cgi?id=121777
+
+        The test from this patch fails (Requested by ap on #webkit).
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calculateAutoscrollDirection):
+
 2013-09-22  Antonio Gomes  <a1.gomes@sisa.samsung.com>
 
         iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
index 9a648f30d9ad0069951e199ce0481ad199f1d4fe..af3011907643576a9045bbd67f2d6f34ea4363a4 100644 (file)
@@ -842,23 +842,20 @@ bool RenderBox::canAutoscroll() const
 // scrolling.
 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) const
 {
+    IntSize offset;
+    IntPoint point = view().frameView().windowToContents(windowPoint);
     IntRect box(absoluteBoundingBoxRect());
-    box.move(view().frameView().scrollOffset());
-    IntRect windowBox = view().frameView().contentsToWindow(box);
 
-    IntPoint windowAutoscrollPoint = windowPoint;
+    if (point.x() < box.x() + autoscrollBeltSize)
+        point.move(-autoscrollBeltSize, 0);
+    else if (point.x() > box.maxX() - autoscrollBeltSize)
+        point.move(autoscrollBeltSize, 0);
 
-    if (windowAutoscrollPoint.x() < windowBox.x() + autoscrollBeltSize)
-        windowAutoscrollPoint.move(-autoscrollBeltSize, 0);
-    else if (windowAutoscrollPoint.x() > windowBox.maxX() - autoscrollBeltSize)
-        windowAutoscrollPoint.move(autoscrollBeltSize, 0);
-
-    if (windowAutoscrollPoint.y() < windowBox.y() + autoscrollBeltSize)
-        windowAutoscrollPoint.move(0, -autoscrollBeltSize);
-    else if (windowAutoscrollPoint.y() > windowBox.maxY() - autoscrollBeltSize)
-        windowAutoscrollPoint.move(0, autoscrollBeltSize);
-
-    return windowAutoscrollPoint - windowPoint;
+    if (point.y() < box.y() + autoscrollBeltSize)
+        point.move(0, -autoscrollBeltSize);
+    else if (point.y() > box.maxY() - autoscrollBeltSize)
+        point.move(0, autoscrollBeltSize);
+    return view().frameView().contentsToWindow(point) - windowPoint;
 }
 
 RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer)