Bug 248401

Summary: ValidityState reports "valid" for partially completed dates
Product: WebKit Reporter: Jeremy Frey <jeremy.m.frey>
Component: FormsAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, cdumez, karlcow, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Intel)   
OS: macOS 11   
See Also: https://bugs.webkit.org/show_bug.cgi?id=148873

Description Jeremy Frey 2022-11-28 09:13:36 PST
Repro steps:

1. In an `<input type="date" />` element, use the keyboard to enter the month, day, or year portion of the date.
2. Leave the other date parts blank.
3. Inspect the element's ValidityState.

Expected:

`{ badInput: true, valid: false }`

Actual:

`{ badInput: false, valid: true }`

AFAIK, Blink and Gecko report badInput: true in this scenario.

A closely-related question was asked on SO which doesn't have any answers due to the current behavior: https://stackoverflow.com/questions/72915862/javascript-date-input-in-safari-validation-31-of-february-year
Comment 2 Radar WebKit Bug Importer 2022-12-05 09:14:17 PST
<rdar://problem/102984901>
Comment 3 Tim Nguyen (:ntim) 2023-05-05 14:58:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13523
Comment 4 EWS 2023-05-05 22:27:05 PDT
Committed 263748@main (ec9036933491): <https://commits.webkit.org/263748@main>

Reviewed commits have been landed. Closing PR #13523 and removing active labels.