DescriptionMerge 138365
> Fix typing zero into multiple field input
> https://bugs.webkit.org/show_bug.cgi?id=105501
>
> Reviewed by Kent Tamura.
>
> Source/WebCore:
>
> We have a couple of problems when handling zero in a multiple fields
> element.
> 1. Typing '02' into a month field will set '12'.
> 2. Typing '0' into 12 hour hour field will set '12' and move to the
> focus to the next field.
> This change adds a type ahead buffer so we can handle these cases
> properly. If the value in the type ahead buffer is valid we set it so a
> change event will fire.
>
> Added tests to *-multiple-fields-keyboard-events.html.
>
> * html/shadow/DateTimeNumericFieldElement.cpp:
> (WebCore::DateTimeNumericFieldElement::didBlur): Clear the type ahead
> buffer. handleKeyboardEvent() won't set the type ahead value if it is
> not in range, so we set the value here.
> (WebCore::DateTimeNumericFieldElement::handleKeyboardEvent):
> (WebCore::DateTimeNumericFieldElement::setEmptyValue): Clear type ahead buffer.
> (WebCore::DateTimeNumericFieldElement::setValueAsInteger):
> (WebCore::DateTimeNumericFieldElement::stepDown): Clear type ahead buffer.
> (WebCore::DateTimeNumericFieldElement::stepUp): Clear type ahead buffer.
> (WebCore::DateTimeNumericFieldElement::typeAheadValue): Returns integer
> value for the type ahead characters.
> (WebCore):
> (WebCore::DateTimeNumericFieldElement::visibleValue): If we have type
> ahead characters, show that.
> * html/shadow/DateTimeNumericFieldElement.h:
> (DateTimeNumericFieldElement):
>
> LayoutTests:
>
> * fast/forms/date-multiple-fields/date-multiple-fields-keyboard-events-expected.txt:
> * fast/forms/date-multiple-fields/date-multiple-fields-keyboard-events.html:
> * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-keyboard-events-expected.txt:
> * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-keyboard-events.html:
> * fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events-expected.txt:
> * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt:
> * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html:
> * fast/forms/week-multiple-fields/week-multiple-fields-keyboard-events-expected.txt:
> * fast/forms/week-multiple-fields/week-multiple-fields-keyboard-events.html:
>
TBR=keishi@webkit.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=139035
Patch Set 1 #Messages
Total messages: 1 (0 generated)
|