Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5b73f8e46d3aa14144afe2cd034da272756daf8d
      
https://github.com/WebKit/WebKit/commit/5b73f8e46d3aa14144afe2cd034da272756daf8d
  Author: Ahmad Saleem <[email protected]>
  Date:   2024-06-18 (Tue, 18 Jun 2024)

  Changed paths:
    M LayoutTests/fast/forms/date/date-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/date/date-stepup-stepdown.html
    M LayoutTests/fast/forms/date/input-date-validation-message-expected.txt
    M LayoutTests/fast/forms/date/input-date-validation-message.html
    M 
LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html
    M LayoutTests/fast/forms/month/month-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/month/month-stepup-stepdown.html
    M LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/number/number-stepup-stepdown.html
    M LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/range/range-stepup-stepdown.html
    M LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/time/time-stepup-stepdown.html
    M LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt
    M LayoutTests/fast/forms/week/week-stepup-stepdown.html
    M Source/WebCore/html/DateInputType.cpp
    M Source/WebCore/html/DateTimeLocalInputType.cpp
    M Source/WebCore/html/InputType.cpp
    M Source/WebCore/html/InputType.h
    M Source/WebCore/html/MonthInputType.cpp
    M Source/WebCore/html/NumberInputType.cpp
    M Source/WebCore/html/RangeInputType.cpp
    M Source/WebCore/html/StepRange.cpp
    M Source/WebCore/html/TimeInputType.cpp
    M Source/WebCore/html/WeekInputType.cpp

  Log Message:
  -----------
  Update input[type=*]'s step base handling to match spec

https://bugs.webkit.org/show_bug.cgi?id=254761
rdar://problem/107721910

Reviewed by Aditya Keerthi.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Merge [1]: 
https://chromium.googlesource.com/chromium/src.git/+/0f836e3f330abbd76df604090db47c6e8fccd5b1

Determine the step base for an input element per spec:

Spec: https://html.spec.whatwg.org/#concept-input-min-zero

That is, consult the 'value' attribute if 'min' is not present, and
then fallback to the default step base for the input type if that
isn't present either. Previously, 'value' was not considered.

Merge [2]: 
https://chromium.googlesource.com/chromium/src.git/+/f0af3d9cd0b5e0b05f20cd8c4f20103f572f14ef

The HTML spec recently shifted to using 'value' as the first fallback
option for an input element's "step base" (if no 'min' attribute):

Spec: https://html.spec.whatwg.org/#concept-input-min-zero

Also bring type=range elements into line with that, including using
that step base when clamping values to the supported range.

Merge [3]: 
https://chromium.googlesource.com/chromium/src.git/+/807ab32fd2e5accda8c5cef2678e0e0af23158b0

According to the specification, we should not resolve step-mismatch if there are
no step-matched values in the range. So, StepRange::clampValue() should return
the minimum value or the maximum value.

Spec: 
https://html.spec.whatwg.org/multipage/input.html#range-state-(type%3Drange)

Merge [4]: 
https://github.com/chromium/chromium/commit/fb67b3219964064ba741ffbba0f3f568a23572e0

The spec for stepUp()/stepDown():

Spec: https://html.spec.whatwg.org/#dom-input-stepdown

requires that out-of-step values snap to step, just like the UI
implementation will do. Hence, bring the required clamping/snapping
handling into scope.

NOTE - It matches Blink from top of tree to avoid stack overflow issue:

Stack Overflow: 
https://source.chromium.org/chromium/chromium/src/+/ebc1f01b3fdba6c8b1b2b1075e029cd317c685ee

* Source/WebCore/html/InputType.cpp:
(InputType::findStepBase): Add Helping function
(InputType::applyStep): Update to spec
* Source/WebCore/html/InputType.h: Helper function definition
* Source/WebCore/html/MonthInputType.cpp:
(MonthInputType::defaultValueForStepUp): Use ’findStepBase’
* Source/WebCore/html/NumberInputType.cpp:
(NumberInputType::createStepRange): Use ’findStepBase’ and remove already 
covered ‘NaN’ handling
* Source/WebCore/html/TimeInputType.cpp:
(TimeInputType:: createStepRange): Use ’findStepBase’
* Source/WebCore/html/WeekInputType.cpp:
(WeekInputType:: createStepRange): Use ’findStepBase’
* Source/WebCore/html/RangeInputType.cpp:
(RangeInputType::createStepRange): Use 'findStepBase'
* Source/WebCore/html/StepRange.cpp:
(StepRange::clampValue): clampValue but respect 'stepBase'
* LayoutTests/fast/forms/week/week-stepup-stepdown.html:
* LayoutTests/fast/forms/time/time-stepup-stepdown.html:
* LayoutTests/fast/forms/range/range-stepup-stepdown.html: Removed duplicate 
tests as well
* LayoutTests/fast/forms/number/number-stepup-stepdown.html: Ditto
* LayoutTests/fast/forms/month/month-stepup-stepdown.html:
* LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html:
* LayoutTests/fast/forms/date/date-stepup-stepdown.html:
* LayoutTests/fast/forms/date/date-stepup-stepdown-expected.txt: Rebaselined
* 
LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt:
 Ditto
* LayoutTests/fast/forms/month/month-stepup-stepdown-expected.txt: Ditto
* LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt: Ditto
* LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt: Fail Tests 
also fail in Blink
* LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt: Rebaselined
* LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt: Rebaselined
* LayoutTests/fast/forms/date/input-date-validation-message.html: Rebaselined

Canonical link: https://commits.webkit.org/280127@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to