Changeset 139503 in webkit


Ignore:
Timestamp:
Jan 11, 2013 2:52:31 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r139044.
http://trac.webkit.org/changeset/139044
https://bugs.webkit.org/show_bug.cgi?id=106702

Caused various scrolling anomolies on Mac with drag and drop
(Requested by smfr on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-11

Source/WebCore:

  • page/AutoscrollController.cpp:

(WebCore::AutoscrollController::AutoscrollController):
(WebCore::AutoscrollController::autoscrollTimerFired):

  • page/AutoscrollController.h:

(WebCore):
(AutoscrollController):

  • page/EventHandler.cpp:

(WebCore::EventHandler::updateDragAndDrop):

  • rendering/RenderBox.cpp:

(WebCore):
(WebCore::RenderBox::autoscroll):

  • rendering/RenderBox.h:

(RenderBox):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::autoscroll):

  • rendering/RenderLayer.h:

(RenderLayer):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::autoscroll):

  • rendering/RenderListBox.h:

(RenderListBox):

  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::autoscroll):

  • rendering/RenderTextControlSingleLine.h:

(RenderTextControlSingleLine):

Source/WebKit/chromium:

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::dragSourceEndedAt):
(WebKit::WebViewImpl::dragSourceMovedTo):
(WebKit::WebViewImpl::dragTargetDrop):
(WebKit::WebViewImpl::dragTargetDragEnterOrOver):

  • src/WebViewImpl.h:

(WebKit):

LayoutTests:

  • fast/events/drag-and-drop-autoscroll-expected.txt: Removed.
  • fast/events/drag-and-drop-autoscroll.html: Removed.
Location:
trunk
Files:
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139502 r139503  
     12013-01-11  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r139044.
     4        http://trac.webkit.org/changeset/139044
     5        https://bugs.webkit.org/show_bug.cgi?id=106702
     6
     7        Caused various scrolling anomolies on Mac with drag and drop
     8        (Requested by smfr on #webkit).
     9
     10        * fast/events/drag-and-drop-autoscroll-expected.txt: Removed.
     11        * fast/events/drag-and-drop-autoscroll.html: Removed.
     12
    1132013-01-11  Rafael Weinstein  <rafaelw@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r139502 r139503  
     12013-01-11  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r139044.
     4        http://trac.webkit.org/changeset/139044
     5        https://bugs.webkit.org/show_bug.cgi?id=106702
     6
     7        Caused various scrolling anomolies on Mac with drag and drop
     8        (Requested by smfr on #webkit).
     9
     10        * page/AutoscrollController.cpp:
     11        (WebCore::AutoscrollController::AutoscrollController):
     12        (WebCore::AutoscrollController::autoscrollTimerFired):
     13        * page/AutoscrollController.h:
     14        (WebCore):
     15        (AutoscrollController):
     16        * page/EventHandler.cpp:
     17        (WebCore::EventHandler::updateDragAndDrop):
     18        * rendering/RenderBox.cpp:
     19        (WebCore):
     20        (WebCore::RenderBox::autoscroll):
     21        * rendering/RenderBox.h:
     22        (RenderBox):
     23        * rendering/RenderLayer.cpp:
     24        (WebCore::RenderLayer::autoscroll):
     25        * rendering/RenderLayer.h:
     26        (RenderLayer):
     27        * rendering/RenderListBox.cpp:
     28        (WebCore::RenderListBox::autoscroll):
     29        * rendering/RenderListBox.h:
     30        (RenderListBox):
     31        * rendering/RenderTextControlSingleLine.cpp:
     32        (WebCore::RenderTextControlSingleLine::autoscroll):
     33        * rendering/RenderTextControlSingleLine.h:
     34        (RenderTextControlSingleLine):
     35
    1362013-01-11  Rafael Weinstein  <rafaelw@chromium.org>
    237
  • trunk/Source/WebCore/page/AutoscrollController.cpp

    r139044 r139503  
    3636#include "RenderBox.h"
    3737#include "ScrollView.h"
    38 #include <wtf/CurrentTime.h>
    3938
    4039namespace WebCore {
    41 
    42 // Delay time in second for start autoscroll if pointer is in border edge of scrollable element.
    43 static double autoscrollDelay = 0.2;
    4440
    4541// When the autoscroll or the panScroll is triggered when do the scroll every 0.05s to make it smooth
     
    5854    , m_autoscrollRenderer(0)
    5955    , m_autoscrollType(NoAutoscroll)
    60     , m_dragAndDropAutoscrollStartTime(0)
    6156#if ENABLE(PAN_SCROLLING)
    6257    , m_panScrollButtonPressed(false)
     
    150145}
    151146
    152 void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoint& eventPosition, double eventTime)
    153 {
    154     if (!dropTargetNode) {
    155         stopAutoscrollTimer();
    156         return;
    157     }
    158 
    159     RenderBox* scrollable = RenderBox::findAutoscrollable(dropTargetNode->renderer());
    160     if (!scrollable) {
    161         stopAutoscrollTimer();
    162         return;
    163     }
    164 
    165     IntSize offset = scrollable->calculateAutoscrollDirection(eventPosition);
    166     if (offset.isZero()) {
    167         stopAutoscrollTimer();
    168         return;
    169     }
    170 
    171     m_dragAndDropAutoscrollReferencePosition = eventPosition + offset;
    172 
    173     if (m_autoscrollType == NoAutoscroll) {
    174         m_autoscrollType = AutoscrollForDragAndDrop;
    175         m_autoscrollRenderer = scrollable;
    176         m_dragAndDropAutoscrollStartTime = eventTime;
    177         startAutoscrollTimer();
    178     } else if (m_autoscrollRenderer != scrollable) {
    179         m_dragAndDropAutoscrollStartTime = eventTime;
    180         m_autoscrollRenderer = scrollable;
    181     }
    182 }
    183 
    184147#if ENABLE(PAN_SCROLLING)
    185148void AutoscrollController::didPanScrollStart()
     
    238201    Frame* frame = m_autoscrollRenderer->frame();
    239202    switch (m_autoscrollType) {
    240     case AutoscrollForDragAndDrop:
    241         if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
    242             m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition);
    243         break;
    244     case AutoscrollForSelection: {
    245         EventHandler* eventHandler = frame->eventHandler();
    246         if (!eventHandler->mousePressed()) {
     203    case AutoscrollForSelection:
     204        if (!frame->eventHandler()->mousePressed()) {
    247205            stopAutoscrollTimer();
    248206            return;
    249207        }
    250         eventHandler->updateSelectionForMouseDrag();
    251         m_autoscrollRenderer->autoscroll(eventHandler->lastKnownMousePosition());
     208        m_autoscrollRenderer->autoscroll();
    252209        break;
    253     }
    254210    case NoAutoscroll:
    255211        break;
  • trunk/Source/WebCore/page/AutoscrollController.h

    r139044 r139503  
    3535class Frame;
    3636class FrameView;
    37 class Node;
    3837class PlatformMouseEvent;
    3938class RenderBox;
     
    4241enum AutoscrollType {
    4342    NoAutoscroll,
    44     AutoscrollForDragAndDrop,
    4543    AutoscrollForSelection,
    4644#if ENABLE(PAN_SCROLLING)
     
    5957    void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
    6058    void updateAutoscrollRenderer();
    61     void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime);
    6259#if ENABLE(PAN_SCROLLING)
    6360    void didPanScrollStart();
     
    7875    RenderBox* m_autoscrollRenderer;
    7976    AutoscrollType m_autoscrollType;
    80     IntPoint m_dragAndDropAutoscrollReferencePosition;
    81     double m_dragAndDropAutoscrollStartTime;
    8277#if ENABLE(PAN_SCROLLING)
    8378    IntPoint m_panScrollStartPos;
  • trunk/Source/WebCore/page/EventHandler.cpp

    r139419 r139503  
    19581958        newTarget = newTarget->parentNode();
    19591959
    1960     m_autoscrollController->updateDragAndDrop(newTarget.get(), event.position(), event.timestamp());
    1961 
    19621960    if (m_dragTarget != newTarget) {
    19631961        // FIXME: this ordering was explicitly chosen to match WinIE. However,
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r139353 r139503  
    8282static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = 0;
    8383
    84 
    85 // Size of border belt for autoscroll. When mouse pointer in border belt,
    86 // autoscroll is started.
    87 static const int autoscrollBeltSize = 20;
    88 
    8984bool RenderBox::s_hadOverflowClip = false;
    9085
     
    704699}
    705700
    706 void RenderBox::autoscroll(const IntPoint& position)
     701void RenderBox::autoscroll()
    707702{
    708703    if (layer())
    709         layer()->autoscroll(position);
     704        layer()->autoscroll();
    710705}
    711706
     
    729724    Page* page = frame->page();
    730725    return page && page->mainFrame() == frame;
    731 }
    732 
    733 // If specified point is in border belt, returned offset denotes direction of
    734 // scrolling.
    735 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) const
    736 {
    737     if (!frame())
    738         return IntSize();
    739 
    740     FrameView* frameView = frame()->view();
    741     if (!frameView)
    742         return IntSize();
    743 
    744     IntSize offset;
    745     IntPoint point = frameView->windowToContents(windowPoint);
    746     IntRect box(absoluteBoundingBoxRect());
    747 
    748     if (point.x() < box.x() + autoscrollBeltSize)
    749         point.move(-autoscrollBeltSize, 0);
    750     else if (point.x() > box.maxX() - autoscrollBeltSize)
    751         point.move(autoscrollBeltSize, 0);
    752 
    753     if (point.y() < box.y() + autoscrollBeltSize)
    754         point.move(0, -autoscrollBeltSize);
    755     else if (point.y() > box.maxY() - autoscrollBeltSize)
    756         point.move(0, autoscrollBeltSize);
    757     return frameView->contentsToWindow(point) - windowPoint;
    758726}
    759727
  • trunk/Source/WebCore/rendering/RenderBox.h

    r139351 r139503  
    448448    bool canBeScrolledAndHasScrollableArea() const;
    449449    virtual bool canBeProgramaticallyScrolled() const;
    450     virtual void autoscroll(const IntPoint&);
     450    virtual void autoscroll();
    451451    bool canAutoscroll() const;
    452     IntSize calculateAutoscrollDirection(const IntPoint& windowPoint) const;
    453452    static RenderBox* findAutoscrollable(RenderObject*);
    454453    virtual void stopAutoscroll() { }
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r139461 r139503  
    22942294}
    22952295
    2296 void RenderLayer::autoscroll(const IntPoint& position)
     2296void RenderLayer::autoscroll()
    22972297{
    22982298    Frame* frame = renderer()->frame();
     
    23042304        return;
    23052305
    2306     IntPoint currentDocumentPosition = frameView->windowToContents(position);
     2306#if ENABLE(DRAG_SUPPORT)
     2307    frame->eventHandler()->updateSelectionForMouseDrag();
     2308#endif
     2309
     2310    IntPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->lastKnownMousePosition());
    23072311    scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
    23082312}
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r139461 r139503  
    374374
    375375    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
    376     void autoscroll(const IntPoint&);
     376    void autoscroll();
    377377
    378378    void resize(const PlatformMouseEvent&, const LayoutSize&);
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r139216 r139503  
    555555}
    556556
    557 void RenderListBox::autoscroll(const IntPoint&)
     557void RenderListBox::autoscroll()
    558558{
    559559    IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->lastKnownMousePosition());
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r139044 r139503  
    8585
    8686    virtual bool canBeProgramaticallyScrolled() const { return true; }
    87     virtual void autoscroll(const IntPoint&);
     87    virtual void autoscroll();
    8888    virtual void stopAutoscroll();
    8989
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r139044 r139503  
    382382}
    383383
    384 void RenderTextControlSingleLine::autoscroll(const IntPoint& position)
     384void RenderTextControlSingleLine::autoscroll()
    385385{
    386386    RenderLayer* layer = innerTextElement()->renderBox()->layer();
    387387    if (layer)
    388         layer->autoscroll(position);
     388        layer->autoscroll();
    389389}
    390390
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r139044 r139503  
    5959    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
    6060
    61     virtual void autoscroll(const IntPoint&);
     61    virtual void autoscroll();
    6262
    6363    // Subclassed to forward to our inner div.
  • trunk/Source/WebKit/chromium/ChangeLog

    r139494 r139503  
     12013-01-11  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r139044.
     4        http://trac.webkit.org/changeset/139044
     5        https://bugs.webkit.org/show_bug.cgi?id=106702
     6
     7        Caused various scrolling anomolies on Mac with drag and drop
     8        (Requested by smfr on #webkit).
     9
     10        * src/WebViewImpl.cpp:
     11        (WebKit::WebViewImpl::WebViewImpl):
     12        (WebKit::WebViewImpl::dragSourceEndedAt):
     13        (WebKit::WebViewImpl::dragSourceMovedTo):
     14        (WebKit::WebViewImpl::dragTargetDrop):
     15        (WebKit::WebViewImpl::dragTargetDragEnterOrOver):
     16        * src/WebViewImpl.h:
     17        (WebKit):
     18
    1192013-01-11  Tony Chang  <tony@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r139252 r139503  
    5454#include "DragController.h"
    5555#include "DragData.h"
     56#include "DragScrollTimer.h"
    5657#include "DragSession.h"
    5758#include "Editor.h"
     
    414415    , m_isTransparent(false)
    415416    , m_tabsToLinks(false)
     417    , m_dragScrollTimer(adoptPtr(new DragScrollTimer))
    416418    , m_isCancelingFullScreen(false)
    417419    , m_benchmarkSupport(this)
     
    32373239    m_page->mainFrame()->eventHandler()->dragSourceEndedAt(pme,
    32383240        static_cast<DragOperation>(operation));
     3241    m_dragScrollTimer->stop();
    32393242}
    32403243
     
    32443247    WebDragOperation operation)
    32453248{
     3249    m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
    32463250}
    32473251
     
    33293333    m_dragOperation = WebDragOperationNone;
    33303334    m_currentDragData = 0;
     3335
     3336    m_dragScrollTimer->stop();
    33313337}
    33323338
     
    33553361
    33563362     m_dragOperation = static_cast<WebDragOperation>(dropEffect);
     3363
     3364    if (dragAction == DragOver)
     3365        m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
     3366    else
     3367        m_dragScrollTimer->stop();
    33573368
    33583369    return m_dragOperation;
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r139252 r139503  
    9292class ContextMenuClientImpl;
    9393class DeviceOrientationClientProxy;
     94class DragScrollTimer;
    9495class GeolocationClientProxy;
    9596class LinkHighlight;
     
    817818    typedef HashMap<WTF::String, WTF::String> SettingsMap;
    818819    OwnPtr<SettingsMap> m_inspectorSettingsMap;
     820    OwnPtr<DragScrollTimer> m_dragScrollTimer;
    819821
    820822#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
Note: See TracChangeset for help on using the changeset viewer.