[DateTimePicker] Check if min and max attributes are valid date strings

RESOLVED FIXED in Firefox 56

Status

()

enhancement
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: scottwu, Assigned: scottwu)

Tracking

(Blocks 1 bug)

unspecified
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(2 attachments)

Assignee

Description

2 years ago
According to the spec[1], the min and max should be valid date strings, and should be set to empty if they aren't.

Currently, the min and max values are used directly in Date constructor, which is very forgiving and can parse the dates that aren't valid date strings. This causes discrepancy between the input box and the picker.

[1] https://html.spec.whatwg.org/multipage/forms.html#date-state-(type=date)
Priority: -- → P1
Assignee

Updated

2 years ago
Assignee: nobody → scwwu
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)
Assignee

Comment 4

2 years ago
Rather than re-implementing the date validation method, I exposed the cpp method via webidl. Do you think this approach is okay :jessica?
Flags: needinfo?(jjong)
(In reply to Scott Wu [:scottwu] from comment #4)
> Rather than re-implementing the date validation method, I exposed the cpp
> method via webidl. Do you think this approach is okay :jessica?

I think it's okay as long as it's chrome only. You can just use "ChromeOnly", I don't think XBL code needs it right now.
And maybe "GetMinimum/Maximum" would be more useful?

Please remember that changing .webdil requires review from a DOM peer.
Flags: needinfo?(jjong)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 8

2 years ago
mozreview-review
Comment on attachment 8885109 [details]
Bug 1364026 - (Part 2) Check if min and max attributes on input type date are valid date strings.

https://reviewboard.mozilla.org/r/155962/#review162604

Looks good, thanks!
Attachment #8885109 - Flags: review?(mconley) → review+

Comment 9

2 years ago
mozreview-review
Comment on attachment 8885108 [details]
Bug 1364026 - (Part 1) Expose HTMLInputElement.getMinimum/getMaximum methods via webidl.

https://reviewboard.mozilla.org/r/155960/#review163096
Attachment #8885108 - Flags: review?(bugs) → review+
Assignee

Comment 10

2 years ago
Thanks :mconley and :smaug! Checking it in.
Keywords: checkin-needed
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Assignee

Comment 13

2 years ago
(In reply to Scott Wu [:scottwu] from comment #12)
> Comment on attachment 8885109 [details]
> Bug 1364026 - (Part 2) Check if min and max attributes on input type date
> are valid date strings.
> 
> Review request updated; see interdiff:
> https://reviewboard.mozilla.org/r/155962/diff/3-4/

Rebased to central and resolved conflicts.

Comment 14

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ee20903b5973
(Part 1) Expose HTMLInputElement.getMinimum/getMaximum methods via webidl. r=smaug
https://hg.mozilla.org/integration/autoland/rev/39f99fa53275
(Part 2) Check if min and max attributes on input type date are valid date strings. r=mconley
Keywords: checkin-needed

Comment 15

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ee20903b5973
https://hg.mozilla.org/mozilla-central/rev/39f99fa53275
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.