Skip to content
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

<input type="week"> does not clamp its value #4591

Merged
merged 1 commit into from Jan 23, 2017
Merged

Conversation

cvrebert
Copy link
Contributor

@cvrebert cvrebert commented Jan 20, 2017

This test assumed that <input type="week"> cannot have its value set to a value that's outside the interval established by its min/max attributes, which is incorrect.

<input type="range"> does perform that sort of clamping, using "When the element is suffering from an underflow/overflow" hooks:
https://html.spec.whatwg.org/multipage/forms.html#range-state-(type=range):suffering-from-an-underflow

But <input type="week">'s section doesn't setup any such hooks AFAICT, nor does its value sanitization algorithm implement any clamping:
https://html.spec.whatwg.org/multipage/forms.html#week-state-(type=week):value-sanitization-algorithm

X-Ref: #4582

This test assumed that <input type="week"> cannot have its value
set to a value that's outside the interval established by its min/max attributes,
which is incorrect.

<input type="range"> does perform that sort of clamping, using
"When the element is suffering from an underflow/overflow" hooks:
https://html.spec.whatwg.org/multipage/forms.html#range-state-(type=range):suffering-from-an-underflow

But <input type="week">'s section doesn't setup any such hooks AFAICT,
nor does its value sanitization algorithm implement any clamping:
https://html.spec.whatwg.org/multipage/forms.html#week-state-(type=week):value-sanitization-algorithm
@wpt-stability-bot
Copy link

Firefox (nightly channel)

Testing web-platform-tests at revision 4c46531
Using browser at version BuildID 20170118211214; SourceStamp a5253dce8b67c2248d7b92ef664a6dd6664e7609
Starting 10 test iterations
All results were stable

All results

/html/semantics/forms/the-input-element/week.html
Subtest Results
OK
Invalid value: no week number PASS
2015 has 53 weeks: Value should be 2015-W53 PASS
Invalid value: yearless week PASS
Invalid value: yearless week and no '-' (U+002D) PASS
Invalid value: year only PASS
Valid value: Value should be 2014-W52 PASS
2014 has 52 weeks: Value should be empty PASS
Value < min attribute PASS
Invalid value: no '-' (U+002D) PASS
Value >= min attribute PASS
empty value PASS
Value <= max attribute PASS
Value > max attribute PASS

@wpt-stability-bot
Copy link

Chrome (unstable channel)

Testing web-platform-tests at revision 4c46531
Using browser at version 55.0.2883.75
Starting 10 test iterations
All results were stable

All results

/html/semantics/forms/the-input-element/week.html
Subtest Results
OK
Invalid value: no week number PASS
2015 has 53 weeks: Value should be 2015-W53 PASS
Invalid value: yearless week PASS
Invalid value: yearless week and no '-' (U+002D) PASS
Invalid value: year only PASS
Valid value: Value should be 2014-W52 PASS
2014 has 52 weeks: Value should be empty PASS
Value < min attribute PASS
Invalid value: no '-' (U+002D) PASS
Value >= min attribute PASS
empty value PASS
Value <= max attribute PASS
Value > max attribute PASS

@cvrebert
Copy link
Contributor Author

Since @wpt-pr-bot seems to have dropped this PR on the floor for some reason...

Notifying @Ms2ger, @ayg, @gsnedders, @jdm, @jgraham, @sideshowbarker, @zcorpan, and @zqzhang.

cvrebert added a commit that referenced this pull request Jan 21, 2017
For the same reasons as #4591 (just s/week/date/g),
<input type="date"> does not clamp its value based on its range limitations from its `min`/`max` attributes.
This test incorrectly expected <input type="date"> to perform such clamping.
jdm pushed a commit that referenced this pull request Jan 21, 2017
For the same reasons as #4591 (just s/week/date/g),
<input type="date"> does not clamp its value based on its range limitations from its `min`/`max` attributes.
This test incorrectly expected <input type="date"> to perform such clamping.
@tkent-google tkent-google merged commit 26ab463 into master Jan 23, 2017
@tkent-google tkent-google deleted the input-week-noclamp branch January 23, 2017 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants