Title: [139044] trunk
Revision
139044
Author
[email protected]
Date
2013-01-08 00:57:56 -0800 (Tue, 08 Jan 2013)

Log Message

Dragging over an element with scrollbars should scroll the element when dragging near edges
https://bugs.webkit.org/show_bug.cgi?id=39725

Reviewed by Hajime Morita.

Source/WebCore:

This patch introduces auto scrolling functionality during drag-and-drop
when drop source is near edge of scrollable element.

When drop source is inside 20px of scrollable element more than 200ms,
scrollable element is automatically scrolled every 50ms toward drop
source position, e.g. vertically scroll up when drop source is in top
edge.

Test: fast/events/drag-and-drop-autoscroll.html

* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::AutoscrollController): Changed to initialize m_dragAndDropAutoscrollStartTime.
(WebCore::AutoscrollController::updateDragAndDrop): Added for start/stop autoscroll during drag-and-drop.
(WebCore::AutoscrollController::autoscrollTimerFired): Changed to add autoscroll for drag-and-drop, and to pass last know position to RenderBox::autoscroll().
* page/AutoscrollController.h:
(AutoscrollController): Changed to add updateDragAndDrop() and m_dragAndDropAutoscrollReferencePosition and m_dragAndDropAutoscrollStartTime.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateDragAndDrop): Changed to call AutoscrollController::updateDragAndDrop().
* rendering/RenderBox.cpp:
(WebCore::RenderBox::autoscroll): Changed for new parameter position.
(WebCore::RenderBox::calculateAutoscrollDirection): Added for autoscroll.
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::autoscroll):  Changed for new parameter position and move updateSelectionForMouseDrag() to AutoscrollController.
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::autoscroll):  Changed for new parameter position.
* rendering/RenderListBox.h:
(RenderListBox):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::autoscroll):  Changed for new parameter position.
* rendering/RenderTextControlSingleLine.h:
(RenderTextControlSingleLine):

Source/WebKit/chromium:

This patch removes DragScrollTimer used for automatic scrolling of main
frame drag-and-drop which is now implemented in EventHandler.

Another patch will remove DragScrollTimer.{cpp,h} and update GYP files to
make patch size small.

No tests. Existing test covers this change.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl): Changed to remove m_dragScrollTimer.
(WebKit::WebViewImpl::dragSourceEndedAt): ditto
(WebKit::WebViewImpl::dragSourceMovedTo): ditto
(WebKit::WebViewImpl::dragTargetDrop): ditto
(WebKit::WebViewImpl::dragTargetDragEnterOrOver): ditto
* src/WebViewImpl.h:
(WebKit): Chagned to remove DragScrollTimer.

LayoutTests:

This patch adds new test for autoscroll during drag-and-drop.

* fast/events/drag-and-drop-autoscroll-expected.txt: Added.
* fast/events/drag-and-drop-autoscroll.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139043 => 139044)


--- trunk/LayoutTests/ChangeLog	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/LayoutTests/ChangeLog	2013-01-08 08:57:56 UTC (rev 139044)
@@ -1,3 +1,15 @@
+2013-01-08  Yoshifumi Inoue  <[email protected]>
+
+        Dragging over an element with scrollbars should scroll the element when dragging near edges
+        https://bugs.webkit.org/show_bug.cgi?id=39725
+
+        Reviewed by Hajime Morita.
+
+        This patch adds new test for autoscroll during drag-and-drop.
+
+        * fast/events/drag-and-drop-autoscroll-expected.txt: Added.
+        * fast/events/drag-and-drop-autoscroll.html: Added.
+
 2013-01-08  Yuki Sekiguchi  <[email protected]>
 
         Float block's logical top margin is illegal in vertical writing mode.

Added: trunk/LayoutTests/fast/events/drag-and-drop-autoscroll-expected.txt (0 => 139044)


--- trunk/LayoutTests/fast/events/drag-and-drop-autoscroll-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/drag-and-drop-autoscroll-expected.txt	2013-01-08 08:57:56 UTC (rev 139044)
@@ -0,0 +1,8 @@
+Check autoscroll by drag-and-drop
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS scrollable.scrollTop > 0
+For manual testing, drag and drop "Drop Me" to "Scrollable" area.
+

Added: trunk/LayoutTests/fast/events/drag-and-drop-autoscroll.html (0 => 139044)


--- trunk/LayoutTests/fast/events/drag-and-drop-autoscroll.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/drag-and-drop-autoscroll.html	2013-01-08 08:57:56 UTC (rev 139044)
@@ -0,0 +1,101 @@
+<html>
+<head>
+<style type="text/css">
+#draggable {
+  padding: 5pt;
+  border: 3px solid #00cc00;
+  background: #00cccc;
+  width: 80px;
+  cursor: hand;
+}
+
+#scrollable {
+    height: 200px;
+    overflow: auto;
+    border: solid 3px #cc0000;
+}
+</style>
+<script>
+function $(id) { return document.getElementById(id); }
+
+function finishTest() {
+    eventSender.mouseUp();
+    $('container').innerHTML = '';
+    window.testRunner.notifyDone();
+}
+
+function testIt() {
+    var draggable = $('draggable');
+    var scrollable = $('scrollable');
+
+    if (!window.eventSender)
+        return;
+
+    eventSender.dragMode = false;
+
+    // Grab draggable
+    eventSender.mouseMoveTo(draggable.offsetLeft + 5, draggable.offsetTop + 5);
+    eventSender.mouseDown();
+
+    // Move mouse to autoscroll border belt.
+    eventSender.mouseMoveTo(scrollable.offsetLeft + 5, scrollable.offsetTop + scrollable.offsetHeight - 10);
+
+    var retryCount = 0;
+
+    function checkScrolled()
+    {
+        if (scrollable.scrollTop > 0) {
+            testPassed('scrollable.scrollTop > 0');
+            finishTest();
+            return;
+        }
+
+        ++retryCount;
+        if (retryCount > 10) {
+            testFailed('No autoscroll');
+            finishTest();
+            return;
+        }
+
+        // Autoscroll is occurred evey 0.05 sec.
+        window.setTimeout(checkScrolled, 50);
+    }
+
+    checkScrolled();
+}
+
+function setUpTest()
+{
+    var scrollable = $('scrollable');
+    for (var i = 0; i < 100; ++i) {
+      var line = document.createElement('div');
+      line.innerHTML = "line " + i;
+      scrollable.appendChild(line);
+    }
+
+    if (!window.eventSender) {
+        console.log('Please run within DumpRenderTree');
+        return;
+    }
+
+    window.jsTestIsAsync = true;
+    window.setTimeout(testIt, 0);
+}
+</script>
+</head>
+<body>
+For manual testing, drag and drop "Drop Me" to "Scrollable" area.
+<div id="container">
+<div id="draggable" draggable="true">Drop Me</div>
+Scrollable
+<div id="scrollable">
+</div>
+</div>
+<script src=""
+<script>
+description('Check autoscroll by drag-and-drop');
+setUpTest();
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (139043 => 139044)


--- trunk/Source/WebCore/ChangeLog	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/ChangeLog	2013-01-08 08:57:56 UTC (rev 139044)
@@ -1,3 +1,46 @@
+2013-01-08  Yoshifumi Inoue  <[email protected]>
+
+        Dragging over an element with scrollbars should scroll the element when dragging near edges
+        https://bugs.webkit.org/show_bug.cgi?id=39725
+
+        Reviewed by Hajime Morita.
+
+        This patch introduces auto scrolling functionality during drag-and-drop
+        when drop source is near edge of scrollable element.
+
+        When drop source is inside 20px of scrollable element more than 200ms,
+        scrollable element is automatically scrolled every 50ms toward drop
+        source position, e.g. vertically scroll up when drop source is in top
+        edge.
+
+        Test: fast/events/drag-and-drop-autoscroll.html
+
+        * page/AutoscrollController.cpp:
+        (WebCore::AutoscrollController::AutoscrollController): Changed to initialize m_dragAndDropAutoscrollStartTime.
+        (WebCore::AutoscrollController::updateDragAndDrop): Added for start/stop autoscroll during drag-and-drop.
+        (WebCore::AutoscrollController::autoscrollTimerFired): Changed to add autoscroll for drag-and-drop, and to pass last know position to RenderBox::autoscroll().
+        * page/AutoscrollController.h:
+        (AutoscrollController): Changed to add updateDragAndDrop() and m_dragAndDropAutoscrollReferencePosition and m_dragAndDropAutoscrollStartTime.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::updateDragAndDrop): Changed to call AutoscrollController::updateDragAndDrop().
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::autoscroll): Changed for new parameter position.
+        (WebCore::RenderBox::calculateAutoscrollDirection): Added for autoscroll.
+        * rendering/RenderBox.h:
+        (RenderBox):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::autoscroll):  Changed for new parameter position and move updateSelectionForMouseDrag() to AutoscrollController.
+        * rendering/RenderLayer.h:
+        (RenderLayer):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::autoscroll):  Changed for new parameter position.
+        * rendering/RenderListBox.h:
+        (RenderListBox):
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::autoscroll):  Changed for new parameter position.
+        * rendering/RenderTextControlSingleLine.h:
+        (RenderTextControlSingleLine):
+
 2013-01-08  Jochen Eisinger  <[email protected]>
 
         REGRESSION(r139036): 'WebCore::DateTimeSymbolicFieldElement::isInRange' hides overloaded virtual function

Modified: trunk/Source/WebCore/page/AutoscrollController.cpp (139043 => 139044)


--- trunk/Source/WebCore/page/AutoscrollController.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/page/AutoscrollController.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -35,9 +35,13 @@
 #include "Page.h"
 #include "RenderBox.h"
 #include "ScrollView.h"
+#include <wtf/CurrentTime.h>
 
 namespace WebCore {
 
+// Delay time in second for start autoscroll if pointer is in border edge of scrollable element.
+static double autoscrollDelay = 0.2;
+
 // When the autoscroll or the panScroll is triggered when do the scroll every 0.05s to make it smooth
 static const double autoscrollInterval = 0.05;
 
@@ -53,6 +57,7 @@
     : m_autoscrollTimer(this, &AutoscrollController::autoscrollTimerFired)
     , m_autoscrollRenderer(0)
     , m_autoscrollType(NoAutoscroll)
+    , m_dragAndDropAutoscrollStartTime(0)
 #if ENABLE(PAN_SCROLLING)
     , m_panScrollButtonPressed(false)
     , m_springLoadedPanScrollInProgress(false)
@@ -144,6 +149,38 @@
     m_autoscrollRenderer = renderer && renderer->isBox() ? toRenderBox(renderer) : 0;
 }
 
+void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoint& eventPosition, double eventTime)
+{
+    if (!dropTargetNode) {
+        stopAutoscrollTimer();
+        return;
+    }
+
+    RenderBox* scrollable = RenderBox::findAutoscrollable(dropTargetNode->renderer());
+    if (!scrollable) {
+        stopAutoscrollTimer();
+        return;
+    }
+
+    IntSize offset = scrollable->calculateAutoscrollDirection(eventPosition);
+    if (offset.isZero()) {
+        stopAutoscrollTimer();
+        return;
+    }
+
+    m_dragAndDropAutoscrollReferencePosition = eventPosition + offset;
+
+    if (m_autoscrollType == NoAutoscroll) {
+        m_autoscrollType = AutoscrollForDragAndDrop;
+        m_autoscrollRenderer = scrollable;
+        m_dragAndDropAutoscrollStartTime = eventTime;
+        startAutoscrollTimer();
+    } else if (m_autoscrollRenderer != scrollable) {
+        m_dragAndDropAutoscrollStartTime = eventTime;
+        m_autoscrollRenderer = scrollable;
+    }
+}
+
 #if ENABLE(PAN_SCROLLING)
 void AutoscrollController::didPanScrollStart()
 {
@@ -200,13 +237,20 @@
 
     Frame* frame = m_autoscrollRenderer->frame();
     switch (m_autoscrollType) {
-    case AutoscrollForSelection:
-        if (!frame->eventHandler()->mousePressed()) {
+    case AutoscrollForDragAndDrop:
+        if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
+            m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition);
+        break;
+    case AutoscrollForSelection: {
+        EventHandler* eventHandler = frame->eventHandler();
+        if (!eventHandler->mousePressed()) {
             stopAutoscrollTimer();
             return;
         }
-        m_autoscrollRenderer->autoscroll();
+        eventHandler->updateSelectionForMouseDrag();
+        m_autoscrollRenderer->autoscroll(eventHandler->lastKnownMousePosition());
         break;
+    }
     case NoAutoscroll:
         break;
 #if ENABLE(PAN_SCROLLING)

Modified: trunk/Source/WebCore/page/AutoscrollController.h (139043 => 139044)


--- trunk/Source/WebCore/page/AutoscrollController.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/page/AutoscrollController.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -34,12 +34,14 @@
 class EventHandler;
 class Frame;
 class FrameView;
+class Node;
 class PlatformMouseEvent;
 class RenderBox;
 class RenderObject;
 
 enum AutoscrollType {
     NoAutoscroll,
+    AutoscrollForDragAndDrop,
     AutoscrollForSelection,
 #if ENABLE(PAN_SCROLLING)
     AutoscrollForPan,
@@ -56,6 +58,7 @@
     void startAutoscrollForSelection(RenderObject*);
     void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
     void updateAutoscrollRenderer();
+    void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime);
 #if ENABLE(PAN_SCROLLING)
     void didPanScrollStart();
     void didPanScrollStop();
@@ -74,6 +77,8 @@
     Timer<AutoscrollController> m_autoscrollTimer;
     RenderBox* m_autoscrollRenderer;
     AutoscrollType m_autoscrollType;
+    IntPoint m_dragAndDropAutoscrollReferencePosition;
+    double m_dragAndDropAutoscrollStartTime;
 #if ENABLE(PAN_SCROLLING)
     IntPoint m_panScrollStartPos;
     bool m_panScrollButtonPressed;

Modified: trunk/Source/WebCore/page/EventHandler.cpp (139043 => 139044)


--- trunk/Source/WebCore/page/EventHandler.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -1963,6 +1963,8 @@
     if (newTarget && newTarget->isTextNode())
         newTarget = newTarget->parentNode();
 
+    m_autoscrollController->updateDragAndDrop(newTarget.get(), event.position(), event.timestamp());
+
     if (m_dragTarget != newTarget) {
         // FIXME: this ordering was explicitly chosen to match WinIE. However,
         // it is sometimes incorrect when dragging within subframes, as seen with

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -81,6 +81,11 @@
 static OverrideSizeMap* gOverrideContainingBlockLogicalHeightMap = 0;
 static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = 0;
 
+
+// Size of border belt for autoscroll. When mouse pointer in border belt,
+// autoscroll is started.
+static const int autoscrollBeltSize = 20;
+
 bool RenderBox::s_hadOverflowClip = false;
 
 RenderBox::RenderBox(Node* node)
@@ -680,10 +685,10 @@
     return hasOverflowClip() && hasLayer() && layer()->usesCompositedScrolling();
 }
 
-void RenderBox::autoscroll()
+void RenderBox::autoscroll(const IntPoint& position)
 {
     if (layer())
-        layer()->autoscroll();
+        layer()->autoscroll(position);
 }
 
 // There are two kinds of renderer that can autoscroll.
@@ -707,6 +712,33 @@
     return page && page->mainFrame() == frame;
 }
 
+// If specified point is in border belt, returned offset denotes direction of
+// scrolling.
+IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) const
+{
+    if (!frame())
+        return IntSize();
+
+    FrameView* frameView = frame()->view();
+    if (!frameView)
+        return IntSize();
+
+    IntSize offset;
+    IntPoint point = frameView->windowToContents(windowPoint);
+    IntRect box(absoluteBoundingBoxRect());
+
+    if (point.x() < box.x() + autoscrollBeltSize)
+        point.move(-autoscrollBeltSize, 0);
+    else if (point.x() > box.maxX() - autoscrollBeltSize)
+        point.move(autoscrollBeltSize, 0);
+
+    if (point.y() < box.y() + autoscrollBeltSize)
+        point.move(0, -autoscrollBeltSize);
+    else if (point.y() > box.maxY() - autoscrollBeltSize)
+        point.move(0, autoscrollBeltSize);
+    return frameView->contentsToWindow(point) - windowPoint;
+}
+
 RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer)
 {
     while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscroll())) {

Modified: trunk/Source/WebCore/rendering/RenderBox.h (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderBox.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -443,8 +443,9 @@
     virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
     bool canBeScrolledAndHasScrollableArea() const;
     virtual bool canBeProgramaticallyScrolled() const;
-    virtual void autoscroll();
+    virtual void autoscroll(const IntPoint&);
     bool canAutoscroll() const;
+    IntSize calculateAutoscrollDirection(const IntPoint& windowPoint) const;
     static RenderBox* findAutoscrollable(RenderObject*);
     virtual void stopAutoscroll() { }
     virtual void panScroll(const IntPoint&);

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -2291,7 +2291,7 @@
     return LayoutRect(LayoutPoint(x, y), visibleRect.size());
 }
 
-void RenderLayer::autoscroll()
+void RenderLayer::autoscroll(const IntPoint& position)
 {
     Frame* frame = renderer()->frame();
     if (!frame)
@@ -2301,11 +2301,7 @@
     if (!frameView)
         return;
 
-#if ENABLE(DRAG_SUPPORT)
-    frame->eventHandler()->updateSelectionForMouseDrag();
-#endif
-
-    IntPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->lastKnownMousePosition());
+    IntPoint currentDocumentPosition = frameView->windowToContents(position);
     scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -374,7 +374,7 @@
     void updateScrollInfoAfterLayout();
 
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
-    void autoscroll();
+    void autoscroll(const IntPoint&);
 
     void resize(const PlatformMouseEvent&, const LayoutSize&);
     bool inResizeMode() const { return m_inResizeMode; }

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -554,7 +554,7 @@
     return listIndexAtOffset(positionOffset);
 }
 
-void RenderListBox::autoscroll()
+void RenderListBox::autoscroll(const IntPoint&)
 {
     IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->lastKnownMousePosition());
 

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -84,7 +84,7 @@
     virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint&);
 
     virtual bool canBeProgramaticallyScrolled() const { return true; }
-    virtual void autoscroll();
+    virtual void autoscroll(const IntPoint&);
     virtual void stopAutoscroll();
 
     virtual bool shouldPanScroll() const { return true; }

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -381,11 +381,11 @@
         && style()->textOverflow() == TextOverflowEllipsis;
 }
 
-void RenderTextControlSingleLine::autoscroll()
+void RenderTextControlSingleLine::autoscroll(const IntPoint& position)
 {
     RenderLayer* layer = innerTextElement()->renderBox()->layer();
     if (layer)
-        layer->autoscroll();
+        layer->autoscroll(position);
 }
 
 int RenderTextControlSingleLine::scrollWidth() const

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (139043 => 139044)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -58,7 +58,7 @@
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
 
-    virtual void autoscroll();
+    virtual void autoscroll(const IntPoint&);
 
     // Subclassed to forward to our inner div.
     virtual int scrollLeft() const;

Modified: trunk/Source/WebKit/chromium/ChangeLog (139043 => 139044)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-08 08:57:56 UTC (rev 139044)
@@ -1,3 +1,27 @@
+2013-01-08  Yoshifumi Inoue  <[email protected]>
+
+        Dragging over an element with scrollbars should scroll the element when dragging near edges
+        https://bugs.webkit.org/show_bug.cgi?id=39725
+
+        Reviewed by Hajime Morita.
+
+        This patch removes DragScrollTimer used for automatic scrolling of main
+        frame drag-and-drop which is now implemented in EventHandler.
+
+        Another patch will remove DragScrollTimer.{cpp,h} and update GYP files to
+        make patch size small.
+
+        No tests. Existing test covers this change.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl): Changed to remove m_dragScrollTimer.
+        (WebKit::WebViewImpl::dragSourceEndedAt): ditto
+        (WebKit::WebViewImpl::dragSourceMovedTo): ditto
+        (WebKit::WebViewImpl::dragTargetDrop): ditto
+        (WebKit::WebViewImpl::dragTargetDragEnterOrOver): ditto
+        * src/WebViewImpl.h:
+        (WebKit): Chagned to remove DragScrollTimer.
+
 2013-01-07  Steve Block  <[email protected]>
 
         Use toSize() to convert from Int/FloatPoint to Int/FloatSize

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (139043 => 139044)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-08 08:57:56 UTC (rev 139044)
@@ -53,7 +53,6 @@
 #include "DocumentLoader.h"
 #include "DragController.h"
 #include "DragData.h"
-#include "DragScrollTimer.h"
 #include "DragSession.h"
 #include "Editor.h"
 #include "EventHandler.h"
@@ -414,7 +413,6 @@
     , m_autofillPopup(0)
     , m_isTransparent(false)
     , m_tabsToLinks(false)
-    , m_dragScrollTimer(adoptPtr(new DragScrollTimer))
     , m_isCancelingFullScreen(false)
     , m_benchmarkSupport(this)
 #if USE(ACCELERATED_COMPOSITING)
@@ -3227,7 +3225,6 @@
                            false, 0);
     m_page->mainFrame()->eventHandler()->dragSourceEndedAt(pme,
         static_cast<DragOperation>(operation));
-    m_dragScrollTimer->stop();
 }
 
 void WebViewImpl::dragSourceMovedTo(
@@ -3235,7 +3232,6 @@
     const WebPoint& screenPoint,
     WebDragOperation operation)
 {
-    m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
 }
 
 void WebViewImpl::dragSourceSystemDragEnded()
@@ -3321,8 +3317,6 @@
 
     m_dragOperation = WebDragOperationNone;
     m_currentDragData = 0;
-
-    m_dragScrollTimer->stop();
 }
 
 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers)
@@ -3350,11 +3344,6 @@
 
      m_dragOperation = static_cast<WebDragOperation>(dropEffect);
 
-    if (dragAction == DragOver)
-        m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
-    else
-        m_dragScrollTimer->stop();
-
     return m_dragOperation;
 }
 

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (139043 => 139044)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-08 08:40:10 UTC (rev 139043)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-08 08:57:56 UTC (rev 139044)
@@ -89,7 +89,6 @@
 class ContextFeaturesClientImpl;
 class ContextMenuClientImpl;
 class DeviceOrientationClientProxy;
-class DragScrollTimer;
 class GeolocationClientProxy;
 class LinkHighlight;
 class NonCompositedContentHost;
@@ -812,7 +811,6 @@
 
     typedef HashMap<WTF::String, WTF::String> SettingsMap;
     OwnPtr<SettingsMap> m_inspectorSettingsMap;
-    OwnPtr<DragScrollTimer> m_dragScrollTimer;
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // The provider of desktop notifications;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to