Changeset 143560 in webkit


Ignore:
Timestamp:
Feb 20, 2013 8:21:32 PM (11 years ago)
Author:
mkwst@chromium.org
Message:

Mouseup event does not fire on Scroll Bar
https://bugs.webkit.org/show_bug.cgi?id=25811

Reviewed by Tony Chang.

Source/WebCore:

Currently, clicking on a scrollbar fires a mousedown event, but not a
mouseup event. This causes problems for code like jQuery UI's
draggable[1], as the drag starts, but is never cancelled. Other use
cases are noted in the slightly old Chromium bug[2].

If a mouseup event is received after a mousedown event on a scrollbar,
this patch dispatches a mouseup event on the same node the mousedown
event dispatched on. This matches Gecko's behavior.

[1]: http://bugs.jqueryui.com/ticket/6925
[2]: http://crbug.com/14204

Tests: fast/scrolling/scrollbar-mousedown-mouseup.html

fast/scrolling/scrollbar-mousedown-move-mouseup.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleMouseReleaseEvent):

If a mouseup event follow a mousedown event on a scrollbar,
dispatch an event on the same node from which the mousedown event
was triggered.

LayoutTests:

  • fast/scrolling/scrollbar-mousedown-mouseup-expected.txt: Added.
  • fast/scrolling/scrollbar-mousedown-mouseup.html: Added.
  • fast/scrolling/scrollbar-mousedown-move-mouseup-expected.txt: Added.
  • fast/scrolling/scrollbar-mousedown-move-mouseup.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143559 r143560  
     12013-02-20  Mike West  <mkwst@chromium.org>
     2
     3        Mouseup event does not fire on Scroll Bar
     4        https://bugs.webkit.org/show_bug.cgi?id=25811
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/scrolling/scrollbar-mousedown-mouseup-expected.txt: Added.
     9        * fast/scrolling/scrollbar-mousedown-mouseup.html: Added.
     10        * fast/scrolling/scrollbar-mousedown-move-mouseup-expected.txt: Added.
     11        * fast/scrolling/scrollbar-mousedown-move-mouseup.html: Added.
     12
    1132013-02-20  Takashi Toyoshima  <toyoshim@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r143556 r143560  
     12013-02-20  Mike West  <mkwst@chromium.org>
     2
     3        Mouseup event does not fire on Scroll Bar
     4        https://bugs.webkit.org/show_bug.cgi?id=25811
     5
     6        Reviewed by Tony Chang.
     7
     8        Currently, clicking on a scrollbar fires a mousedown event, but not a
     9        mouseup event. This causes problems for code like jQuery UI's
     10        draggable[1], as the drag starts, but is never cancelled. Other use
     11        cases are noted in the slightly old Chromium bug[2].
     12
     13        If a mouseup event is received after a mousedown event on a scrollbar,
     14        this patch dispatches a mouseup event on the same node the mousedown
     15        event dispatched on. This matches Gecko's behavior.
     16
     17        [1]: http://bugs.jqueryui.com/ticket/6925
     18        [2]: http://crbug.com/14204
     19
     20        Tests: fast/scrolling/scrollbar-mousedown-mouseup.html
     21               fast/scrolling/scrollbar-mousedown-move-mouseup.html
     22
     23        * page/EventHandler.cpp:
     24        (WebCore::EventHandler::handleMouseReleaseEvent):
     25            If a mouseup event follow a mousedown event on a scrollbar,
     26            dispatch an event on the same node from which the mousedown event
     27            was triggered.
     28
    1292013-02-20  Takashi Sakamoto  <tasak@google.com>
    230
  • trunk/Source/WebCore/page/EventHandler.cpp

    r143439 r143560  
    18301830    if (m_lastScrollbarUnderMouse) {
    18311831        invalidateClick();
    1832         return m_lastScrollbarUnderMouse->mouseUp(mouseEvent);
     1832        m_lastScrollbarUnderMouse->mouseUp(mouseEvent);
     1833        bool cancelable = true;
     1834        bool setUnder = false;
     1835        return !dispatchMouseEvent(eventNames().mouseupEvent, m_lastNodeUnderMouse.get(), cancelable, m_clickCount, mouseEvent, setUnder);
    18331836    }
    18341837
Note: See TracChangeset for help on using the changeset viewer.