⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 140489 in webkit


Ignore:
Timestamp:
Jan 22, 2013, 5:33:55 PM (14 years ago)
Author:
yosin@chromium.org
Message:

Merge 140104

REGRESSION(r137726): Spring Loaded Pan Scrolling doesn't stop
https://bugs.webkit.org/show_bug.cgi?id=107205

Reviewed by Hajime Morita.

Source/WebCore:

The bug is caused by forgetting to set true m_panScrollButtonPressed
in AutoscrollController::startPanScroll().

This patch changes state management during pan scroll by replacing
m_panScrollButtonPressed and m_springLoadedPanScrollInProgress by
m_autoscrollType with introducing new AutoscrollController state
AutoscrollForPanCanStop.

Tests: platform/chromium-win/fast/events/panScroll-click.html

platform/chromium-win/fast/events/panScroll-drag.html

  • page/AutoscrollController.cpp:

(WebCore::AutoscrollController::AutoscrollController): Changed to remove initialization of m_panScrollButtonPressed and m_springLoadedPanScrollInProgress.
(WebCore::AutoscrollController::stopAutoscrollTimer): Changed to remove resetting m_panScrollButtonPressed and m_springLoadedPanScrollInProgress.
(WebCore::AutoscrollController::handleMouseReleaseEvent): Changed to handle AutoscrollForPan and AutoscrollForPanCanStop.
(WebCore::AutoscrollController::panScrollInProgress): Changed to check AutoscrollForPanCanStop too.
(WebCore::AutoscrollController::startPanScrolling): Changed to remove setting of m_springLoadedPanScrollInProgress.
(WebCore::AutoscrollController::autoscrollTimerFired): Changed to add case for AutoscrollForPanCanStop.
(WebCore::AutoscrollController::updatePanScrollState): Chagned to use AutoscrollForPan and AutoscrollForPanCanStop.

  • page/AutoscrollController.h:

(AutoscrollController): Changed to add AutoscrollForPanCanStop to AutoscrollType.

LayoutTests:

  • platform/chromium-win/fast/events/panScroll-click-expected.txt: Added.
  • platform/chromium-win/fast/events/panScroll-click.html: Added.
  • platform/chromium-win/fast/events/panScroll-drag-expected.txt: Added.
  • platform/chromium-win/fast/events/panScroll-drag.html: Added.
  • platfrom/chromium/TestExpectations: Skip panScroll-{click,drag}.html for Android, Linux, and Mac.

TBR=yosin@chromium.org
Review URL: https://codereview.chromium.org/12040032

Location:
branches/chromium/1364
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/chromium/1364/LayoutTests/platform/chromium/TestExpectations

    r140464 r140489  
    20702070webkit.org/b/104991 [ Android Linux Mac ] platform/chromium-win/fast/events/panScroll-nested-divs.html [ Skip ]
    20712071
     2072webkit.org/b/107205 [ Android Linux Mac ] platform/chromium-win/fast/events/panScroll-click.html [ Skip ]
     2073webkit.org/b/107205 [ Android Linux Mac ] platform/chromium-win/fast/events/panScroll-drag.html [ Skip ]
     2074
    20722075crbug.com/31623 [ SnowLeopard Win ] http/tests/appcache/remove-cache.html [ Failure Pass Timeout ]
    20732076
  • branches/chromium/1364/Source/WebCore/page/AutoscrollController.cpp

    r137726 r140489  
    5454    , m_autoscrollRenderer(0)
    5555    , m_autoscrollType(NoAutoscroll)
    56 #if ENABLE(PAN_SCROLLING)
    57     , m_panScrollButtonPressed(false)
    58     , m_springLoadedPanScrollInProgress(false)
    59 #endif
    6056{
    6157}
     
    9086    m_autoscrollType = NoAutoscroll;
    9187    m_autoscrollRenderer = 0;
    92 #if ENABLE(PAN_SCROLLING)
    93     m_panScrollButtonPressed = false;
    94     m_springLoadedPanScrollInProgress = false;
    95 #endif
    9688
    9789    if (!scrollable)
     
    158150void AutoscrollController::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
    159151{
    160     if (mouseEvent.button() == MiddleButton)
    161         m_panScrollButtonPressed = false;
    162     if (m_springLoadedPanScrollInProgress)
     152    switch (m_autoscrollType) {
     153    case AutoscrollForPan:
     154        if (mouseEvent.button() == MiddleButton)
     155            m_autoscrollType = AutoscrollForPanCanStop;
     156        break;
     157    case AutoscrollForPanCanStop:
    163158        stopAutoscrollTimer();
     159        break;
     160    }
    164161}
    165162
    166163bool AutoscrollController::panScrollInProgress() const
    167164{
    168     return m_autoscrollType == AutoscrollForPan;
     165    return m_autoscrollType == AutoscrollForPan || m_autoscrollType == AutoscrollForPanCanStop;
    169166}
    170167
     
    178175    m_autoscrollRenderer = scrollable;
    179176    m_panScrollStartPos = lastKnownMousePosition;
    180     m_springLoadedPanScrollInProgress = false;
    181177
    182178    if (FrameView* view = scrollable->frame()->view())
     
    211207        break;
    212208#if ENABLE(PAN_SCROLLING)
     209    case AutoscrollForPanCanStop:
    213210    case AutoscrollForPan:
    214211        // we verify that the main frame hasn't received the order to stop the panScroll
     
    242239    bool south = m_panScrollStartPos.y() < (lastKnownMousePosition.y() - ScrollView::noPanScrollRadius);
    243240
    244     if ((east || west || north || south) && m_panScrollButtonPressed)
    245         m_springLoadedPanScrollInProgress = true;
     241    if (m_autoscrollType == AutoscrollForPan && (east || west || north || south))
     242        m_autoscrollType = AutoscrollForPanCanStop;
    246243
    247244    if (north) {
  • branches/chromium/1364/Source/WebCore/page/AutoscrollController.h

    r137726 r140489  
    4343    AutoscrollForSelection,
    4444#if ENABLE(PAN_SCROLLING)
     45    AutoscrollForPanCanStop,
    4546    AutoscrollForPan,
    4647#endif
     
    7778#if ENABLE(PAN_SCROLLING)
    7879    IntPoint m_panScrollStartPos;
    79     bool m_panScrollButtonPressed;
    80     bool m_springLoadedPanScrollInProgress;
    8180#endif
    8281};
Note: See TracChangeset for help on using the changeset viewer.