Steps To Reproduce: 1. Go to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types 2. Scroll down to the “datetime-local” input 3. Click on the input to open the calendar 4. Click a date on the calendar Results: The second and millisecond fields are added to the input after choosing a date from the calendar. These fields should not be added to the input.
<rdar://problem/73943517>
Created attachment 419170 [details] Patch
Comment on attachment 419170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419170&action=review r=me, nice patch! > Source/WebCore/html/BaseDateAndTimeInputType.cpp:548 > + auto date = parseToDateComponents(element.value()); > + if (date) { rather than have an `else` could you `parseToDateComponents(element.value()).valueOr({ })`? > Source/WebCore/platform/DateTimeChooserParameters.h:54 > bool required; > bool isAnchorElementRTL; > bool useDarkAppearance; > + bool hasSecondField; > + bool hasMillisecondField; I wonder if all of these should have a default value `{ false }` (or `{ 0 }` for the `double`s) or something 🤔
(In reply to Devin Rousso from comment #3) > Comment on attachment 419170 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=419170&action=review > > r=me, nice patch! Thanks for the review! > > Source/WebCore/html/BaseDateAndTimeInputType.cpp:548 > > + auto date = parseToDateComponents(element.value()); > > + if (date) { > > rather than have an `else` could you > `parseToDateComponents(element.value()).valueOr({ })`? Didn't know about valueOr! Will make the change. > > Source/WebCore/platform/DateTimeChooserParameters.h:54 > > bool required; > > bool isAnchorElementRTL; > > bool useDarkAppearance; > > + bool hasSecondField; > > + bool hasMillisecondField; > > I wonder if all of these should have a default value `{ false }` (or `{ 0 }` > for the `double`s) or something 🤔 They probably should, will make the change.
Created attachment 419185 [details] Patch for landing
Committed r272368: <https://trac.webkit.org/changeset/272368> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419185 [details].