Changeset 140324 in webkit
- Timestamp:
- Jan 21, 2013 4:50:30 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140321 r140324 1 2013-01-21 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: should not dispatch 'input' events if the element value is not updated 4 https://bugs.webkit.org/show_bug.cgi?id=107429 5 6 Reviewed by Kentaro Hara. 7 8 * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt: 9 * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html: 10 1 11 2013-01-21 Alexander Pavlov <apavlov@chromium.org> 2 12 -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt
r138365 r140324 14 14 15 15 == Digit keys == 16 PASS eventsCounter.input is undefined. 17 PASS eventsCounter.change is undefined. 16 18 PASS input.value is "07:56" 19 PASS eventsCounter.input is 1 20 PASS eventsCounter.change is 1 17 21 == Digit keys starting with zero == 18 22 PASS input.value is "14:03" … … 26 30 PASS input.value is "03:56" 27 31 == Up/Down keys on empty value == 32 PASS eventsCounter.input is undefined. 33 PASS eventsCounter.change is undefined. 28 34 PASS input.value is "14:58" 35 PASS eventsCounter.input is 1 36 PASS eventsCounter.change is 1 29 37 == Tab key == 30 38 PASS input.value is "03:05" -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html
r138365 r140324 42 42 } 43 43 44 var eventsCounter = {}; 45 function countEvents(event) 46 { 47 if (eventsCounter[event.type] === undefined) 48 eventsCounter[event.type] = 0; 49 eventsCounter[event.type]++; 50 } 51 input.addEventListener('input', countEvents, false); 52 input.addEventListener('change', countEvents, false); 53 44 54 beginTest('Digit keys'); 45 keyDown('7'); 46 keyDown('5'); 47 keyDown('6'); 48 keyDown('A'); 55 keyDown('7'); // -> 07:[--] -- 56 keyDown('5'); // -> 07:[05] -- 57 keyDown('6'); // -> 07:56 [--] 58 shouldBeUndefined('eventsCounter.input'); 59 shouldBeUndefined('eventsCounter.change'); 60 keyDown('A'); // -> 07:56 [AM] 49 61 shouldBeEqualToString('input.value', '07:56'); 62 shouldBe('eventsCounter.input', '1'); 63 shouldBe('eventsCounter.change', '1'); 50 64 51 65 beginTest('Digit keys starting with zero'); … … 98 112 99 113 beginTest('Up/Down keys on empty value', ''); 100 keyDown('upArrow'); 101 keyDown('upArrow'); 102 keyDown('rightArrow'); 103 keyDown('downArrow'); 104 keyDown('downArrow'); 105 keyDown('rightArrow'); 106 keyDown('downArrow'); 114 eventsCounter = {}; 115 keyDown('upArrow'); // -> [01]:-- -- 116 keyDown('upArrow'); // -> [02]:-- -- 117 keyDown('rightArrow'); // -> 02:[--] -- 118 keyDown('downArrow'); // -> 02:[59] -- 119 keyDown('downArrow'); // -> 02:[58] -- 120 keyDown('rightArrow'); // -> 02:58 [--] 121 shouldBeUndefined('eventsCounter.input'); 122 shouldBeUndefined('eventsCounter.change'); 123 keyDown('downArrow'); // -> 02:58 [PM] 107 124 shouldBeEqualToString('input.value', '14:58'); 125 shouldBe('eventsCounter.input', '1'); 126 shouldBe('eventsCounter.change', '1'); 108 127 109 128 beginTest('Tab key', '03:00'); -
trunk/Source/WebCore/ChangeLog
r140321 r140324 1 2013-01-21 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: should not dispatch 'input' events if the element value is not updated 4 https://bugs.webkit.org/show_bug.cgi?id=107429 5 6 Reviewed by Kentaro Hara. 7 8 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#common-event-behaviors 9 > any time the user causes the element's value to change, the user agent 10 > must queue a task to fire a simple event that bubbles named input at the 11 > input element. 12 13 Tests: 14 fast/forms/time-multiple-fields/time-multiple-fields-keyboard-event.html 15 is updated to cover this change. 16 17 * html/BaseMultipleFieldsDateAndTimeInputType.cpp: 18 (WebCore::BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged): 19 If the new value is equivalent to the old value, don't dispatch events. 20 However we should recalculate validity and call notifyFormStateChanged 21 because input.validity.badInput state might be changed. 22 1 23 2013-01-21 Alexander Pavlov <apavlov@chromium.org> 2 24 -
trunk/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
r139424 r140324 74 74 { 75 75 RefPtr<HTMLInputElement> input(element()); 76 input->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), DispatchNoEvent); 77 input->setNeedsStyleRecalc(); 78 input->dispatchFormControlInputEvent(); 79 input->dispatchFormControlChangeEvent(); 76 String oldValue = input->value(); 77 String newValue = sanitizeValue(m_dateTimeEditElement->value()); 78 // Even if oldValue is null and newValue is "", we should assume they are same. 79 if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue) 80 input->setNeedsValidityCheck(); 81 else { 82 input->setValueInternal(newValue, DispatchNoEvent); 83 input->setNeedsStyleRecalc(); 84 input->dispatchFormControlInputEvent(); 85 input->dispatchFormControlChangeEvent(); 86 } 80 87 input->notifyFormStateChanged(); 81 88 }
Note: See TracChangeset
for help on using the changeset viewer.