Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
input type=range element should only fire change events after committ…
…ing a value https://bugs.webkit.org/show_bug.cgi?id=134545 Patch by Julien Quint <pom@graougraou.com> on 2014-07-04 Reviewed by Dean Jackson. Source/WebCore: A "change" event was fired every time the slider thumb element was dragged by the user. The "change" event is now fired only after the thumb element has stopped moving; previously, both "input" and "change" events where dispatched while changes were being made. This new behavior is consistent with the specification (cf. http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#event-input-change), as well as other implementations such as Firefox and Chrome. * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.createControls): Listen to the "input" event rather than the "change" event for the timeline control in order to keep track of value changes when the user is dragging the thumb. * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::setValue): Dispatch "change" event while setting the new value rather than dispatching later, since setting the value now clears the change flag. * html/RangeInputType.cpp: (WebCore::RangeInputType::setValue): Update the text value of the control in the case when no event is to be dispatched, so that this value can be checked the next time a "change" event dispatch is requested. * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::setPositionFromPoint): Removed the dispatch of the "change" event, and no longer track the text value of the element as a result of dispatching a "change" event. (WebCore::SliderThumbElement::stopDragging): Dispatch the "change" event on completing the drag. LayoutTests: Two existing tests are updated to count "input" events as well as "change" events. The tests now verify that "change" is only fired once after every slider drag completes, whereas "input" may be fired more than once. * fast/forms/range/range-drag-expected.txt: * fast/forms/range/range-drag-when-toggled-disabled-expected.txt: * fast/forms/range/range-drag-when-toggled-disabled.html: * fast/forms/range/range-drag.html: Canonical link: https://commits.webkit.org/152612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
38b422d
commit 3675d1d
Showing
10 changed files
with
108 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters