Commit 3fd95ce7 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

Reviewed by Sam.

        https://bugs.webkit.org/show_bug.cgi?id=18652
        onchange events don't seem to fire for input[type=range] controls.

        Fire changeEvent when clicking the slider outside the current
        thumb position.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 170267ac
2008-05-03 Rob Buis <buis@kde.org>
Reviewed by Sam.
Extended testcase for:
https://bugs.webkit.org/show_bug.cgi?id=18652
onchange events don't seem to fire for input[type=range] controls.
* fast/forms/slider-onchange-event-expected.txt:
* fast/forms/slider-onchange-event.html:
2008-05-03 Sam Weinig <sam@webkit.org>
Reviewed by Dan Bernstein.
......@@ -2,4 +2,6 @@ This tests that slider controls get the onchange event and that it is sent after
input
change
input
change
......@@ -11,10 +11,19 @@
var slider = document.getElementById('slider');
if (window.layoutTestController) {
layoutTestController.dumpAsText();
// slider drag
eventSender.mouseMoveTo(slider.offsetLeft + 7, slider.offsetTop + 7);
eventSender.mouseDown();
eventSender.mouseMoveTo(slider.offsetLeft + 50, slider.offsetTop + 50);
eventSender.mouseUp();
// single click
eventSender.mouseMoveTo(slider.offsetLeft + 7, slider.offsetTop + 7);
eventSender.mouseDown();
eventSender.mouseUp();
// single click again, should send no onchange event
eventSender.mouseMoveTo(slider.offsetLeft + 7, slider.offsetTop + 7);
eventSender.mouseDown();
eventSender.mouseUp();
}
}
</script>
......
2008-05-03 Rob Buis <buis@kde.org>
Reviewed by Sam.
https://bugs.webkit.org/show_bug.cgi?id=18652
onchange events don't seem to fire for input[type=range] controls.
Fire changeEvent when clicking the slider outside the current
thumb position.
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::setValueForPosition):
2008-05-03 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
......@@ -291,8 +291,10 @@ void RenderSlider::setValueForPosition(int position)
static_cast<HTMLInputElement*>(node())->setValueFromRenderer(String::number(val));
if (position != currentPosition())
if (position != currentPosition()) {
setCurrentPosition(position);
static_cast<HTMLInputElement*>(node())->onChange();
}
}
double RenderSlider::setPositionFromValue(bool inLayout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment