Input type=range issue with events not being raised when value set in js
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 15:51:28 +0000 (15:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 15:51:28 +0000 (15:51 +0000)
commitbdd0ba86732f679ccb7db862829c85f4adf31a4a
tree112079a02e59998dac328330373957f09fceed44
parentc393729461593a83882f5ebb4f1dd0363f5337b4
Input type=range issue with events not being raised when value set in js
https://bugs.webkit.org/show_bug.cgi?id=84674

Source/WebCore:

Fix dispatching of change and click events for the input slider.
Prior to the fix, change events were not fired if the new value
matched the value at last change notification based on expected
behavior for text fields.  Clicks were not fired if the thumb
element was repositioned under the cursor on mouse down.

Patch by Kevin Ellis <kevers@chromium.org> on 2012-07-10
Reviewed by Kent Tamura.

Tests: fast/events/click-range-slider.html
       fast/events/onchange-range-slider.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):

LayoutTests:

Ensure that click and change events are properly triggered for range
sliders.  Prior to the fix, change events were not fired if the new
value matched the value at last change notification based on expected
behavior for text fields.  Clicks were not fired if the thumb element
was positioned under the cursor on mouse down.

Patch by Kevin Ellis <kevers@chromium.org> on 2012-07-10
Reviewed by Kent Tamura.

* fast/events/click-range-slider-expected.txt: Added.
* fast/events/click-range-slider.html: Added.
* fast/events/onchange-range-slider-expected.txt: Added.
* fast/events/onchange-range-slider.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/click-range-slider-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/click-range-slider.html [new file with mode: 0644]
LayoutTests/fast/events/onchange-range-slider-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/onchange-range-slider.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/page/EventHandler.cpp