-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update input[type=*]'s step base handling to match spec #22889
Update input[type=*]'s step base handling to match spec #22889
Conversation
EWS run on previous version of this PR (hash 8062686) |
8062686
to
d12b14a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d12b14a
to
505dfef
Compare
This comment was marked as outdated.
This comment was marked as outdated.
505dfef
to
3480f29
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3480f29
to
15cd60b
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
15cd60b
to
f7f4fcc
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f7f4fcc
to
0a8c482
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0a8c482
to
b8ad8b5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b8ad8b5
to
95ed9b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
95ed9b2
to
98fd461
Compare
This comment was marked as outdated.
This comment was marked as outdated.
98fd461
to
8468c37
Compare
This comment was marked as outdated.
This comment was marked as outdated.
8468c37
to
31291f3
Compare
EWS run on previous version of this PR (hash 31291f3) |
@Ahmad-S792 Are there any WPTs that cover this spec behavior? |
Unfortunately not - at least, I couldn't find one. |
31291f3
to
6b81d5b
Compare
EWS run on previous version of this PR (hash 6b81d5b) |
6b81d5b
to
5f11951
Compare
EWS run on previous version of this PR (hash 5f11951) |
5f11951
to
0749912
Compare
EWS run on current version of this PR (hash 0749912) |
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]: chromium/chromium@fb67b32 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
0749912
to
5b73f8e
Compare
Committed 280127@main (5b73f8e): https://commits.webkit.org/280127@main Reviewed commits have been landed. Closing PR #22889 and removing active labels. |
5b73f8e
0749912