Changeset 140385 in webkit
- Timestamp:
- Jan 21, 2013 10:17:21 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140378 r140385 1 2013-01-21 Kent Tamura <tkent@chromium.org> 2 3 Date selection from calendar picker should dispatch 'input' event in addition to 'change' event 4 https://bugs.webkit.org/show_bug.cgi?id=107427 5 6 Reviewed by Kentaro Hara. 7 8 * platform/chromium/fast/forms/calendar-picker/date-picker-events-expected.txt: Added. 9 * platform/chromium/fast/forms/calendar-picker/date-picker-events.html: Added. 10 * platform/chromium/fast/forms/calendar-picker/datetimelocal-picker-events-expected.txt: Added. 11 * platform/chromium/fast/forms/calendar-picker/datetimelocal-picker-events.html: Added. 12 1 13 2013-01-21 Noel Gordon <noel.gordon@gmail.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r140384 r140385 1 2013-01-21 Kent Tamura <tkent@chromium.org> 2 3 Date selection from calendar picker should dispatch 'input' event in addition to 'change' event 4 https://bugs.webkit.org/show_bug.cgi?id=107427 5 6 Reviewed by Kentaro Hara. 7 8 According to the specification and Opera's behavior, we should dispatch 9 not only 'change' event but also 'input' event when a user chooses a 10 date from the calender picker. 11 12 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#common-event-behaviors 13 > When the user agent changes the element's value on behalf of the user 14 > (e.g. as part of a form prefilling feature), the user agent must follow 15 > these steps: 16 > 1. If the input event applies, queue a task to fire a simple event 17 > that bubbles named input at the input element. 18 > 2. If the change event applies, queue a task to fire a simple event 19 > that bubbles named change at the input element. 20 21 Tests: platform/chromium/fast/forms/calendar-picker/date-picker-events.html 22 platform/chromium/fast/forms/calendar-picker/datetimelocal-picker-events.html 23 24 * html/InputType.cpp: 25 (WebCore::InputType::setValue): Add DispatchInputAndChangeEvent support. 26 * html/BaseChooserOnlyDateAndTimeInputType.cpp: 27 (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue): 28 Use DispatchInputAndChangeEvent, not DispatchChangeEvent. 29 * html/BaseMultipleFieldsDateAndTimeInputType.cpp: 30 (WebCore::BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue): 31 Ditto. 32 1 33 2013-01-21 Justin Schuh <jschuh@chromium.org> 2 34 -
trunk/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
r139424 r140385 97 97 void BaseChooserOnlyDateAndTimeInputType::didChooseValue(const String& value) 98 98 { 99 element()->setValue(value, Dispatch ChangeEvent);99 element()->setValue(value, DispatchInputAndChangeEvent); 100 100 } 101 101 -
trunk/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
r140324 r140385 141 141 { 142 142 if (element()->isValidValue(value)) { 143 element()->setValue(value, Dispatch ChangeEvent);143 element()->setValue(value, DispatchInputAndChangeEvent); 144 144 return; 145 145 } -
trunk/Source/WebCore/html/InputType.cpp
r139410 r140385 675 675 element()->setValueInternal(sanitizedValue, eventBehavior); 676 676 element()->setNeedsStyleRecalc(); 677 if (valueChanged && eventBehavior != DispatchNoEvent) 677 if (!valueChanged) 678 return; 679 switch (eventBehavior) { 680 case DispatchChangeEvent: 678 681 element()->dispatchFormControlChangeEvent(); 682 break; 683 case DispatchInputAndChangeEvent: 684 element()->dispatchFormControlInputEvent(); 685 element()->dispatchFormControlChangeEvent(); 686 break; 687 case DispatchNoEvent: 688 break; 689 } 679 690 } 680 691
Note: See TracChangeset
for help on using the changeset viewer.