Mouseup event does not fire on Scroll Bar
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 04:21:32 +0000 (04:21 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 04:21:32 +0000 (04:21 +0000)
commit8f565c50a56b222f31520e1046522a5901e7f0a0
treed8efcf3f08c331fabc0ec49bb27491c74b708908
parent8e4140ae5644b3ff12d5886d63f4da0f40f2866b
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/scrollbar-mousedown-mouseup-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/scrollbar-mousedown-mouseup.html [new file with mode: 0644]
LayoutTests/fast/scrolling/scrollbar-mousedown-move-mouseup-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/scrollbar-mousedown-move-mouseup.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp