Closed Bug 1608010 Opened 5 years ago Closed 4 years ago

<input type=time> validation does not support reversed range

Categories

(Core :: DOM: Forms, defect, P3)

72 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox72 --- wontfix
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- fixed

People

(Reporter: TimothyGu, Assigned: jdai)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.42 Safari/537.36

Steps to reproduce:

<!DOCTYPE html>
<meta charset=utf-8>
<input type=time min="14:00:00" max="12:00:00" value="15:00:00" id=inputtime>
<script>
console.log(inputtime.validity.rangeOverflow, inputtime.validity.rangeUnderflow);
</script>

WPT available after https://github.com/web-platform-tests/wpt/pull/21103, which is tracked in bug 1608009.

Actual results:

"true false" is printed.

Expected results:

"false false" should be printed.

This is per https://html.spec.whatwg.org/C/#the-min-and-max-attributes, especially the constraint validation rules pertaining to when the element "has a reversed range".

Reproduced on latest FF versions on Windows 10 x64.

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Component: DOM: Core & HTML → DOM: Forms
Priority: -- → P3

Google plans to fix their implementation and support reversed ranges soon. It would be good to proactively avoid a webcompat issue for developers and get the Firefox implementation up to spec without too much of a lag.

Put into my queue, I'll implement it. :)

Assignee: nobody → jdai
Status: NEW → ASSIGNED

FYI, I just submitted the implementation of this in chromium for version 82, and updated the MDN article for <input type=time> by adding a "Making min and max cross midnight" section: https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time$revision/1608939

Keywords: dev-doc-needed

Since it's nearing the end of the Nightly 75 cycle, I'll hold off landing this feature until after the version bump to 76 on March 9th.

Pushed by jdai@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/807eef77548b
Support reversed range for <input type=time>; r=smaug
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: