Add new category for typeable form controls with normalization
There looks to be a popular demand for normalized date and datetime-local as seen in 1470 and 42322342. This introduces a new category to make the expected behavior explicit.
P.S. I wasn't sure if I should group the common logic of non-typable and typeable or not.
@sadym-chromium @whimboo @jgraham do you have a suggestion on how to best tackle input in the date fields? Should WebDriver require normalizing the input format?
@sadym-chromium @whimboo @jgraham do you have a suggestion on how to best tackle input in the date fields? Should WebDriver require normalizing the input format?
Gentle Reminder.
The approach LGTM, but the expected formats should be strictly defined.
The approach LGTM, but the expected formats should be strictly defined.
I was thinking of doing something like this:
<li><p>Normalize the <code>value</code> to conform to the expected input format of <var>element</var>.
<ul>
<li><p>For <code>type="date"</code> inputs, the <code>value</code> may be provided in <code>YYYY-MM-DD</code>, <code>YYYYMMDD</code>, or <code>MM-DD-YYYY</code> formats,
and must be normalized to <code>MM-DD-YYYY</code>.
<li><p>For <code>type="datetime-local"</code> inputs, the <code>value</code> may be provided in <code>YYYY-MM-DDTHH:MM:SS</code> or <code>MM-DD-YYYYTHH:MM:SS</code> formats,
and must be normalized to <code>MM-DD-YYYYTHH:MM:SS</code>.
</ul>
<li><p><a>Set a property</a> <code>value</code> to <var>text</var>
I chose to normalize to MM-DD-YYYY and MM-DD-YYYYTHH:MM:SS since that seems to be what Chromium expects as input, which keeps changes minimal, but I'm not sure if this is the correct approach.
I chose to normalize to MM-DD-YYYY and MM-DD-YYYYTHH:MM:SS since that seems to be what Chromium expects as input, which keeps changes minimal, but I'm not sure if this is the correct approach.
Does Chromium not support ISO 8601? I think that we should follow that format.
I chose to normalize to MM-DD-YYYY and MM-DD-YYYYTHH:MM:SS since that seems to be what Chromium expects as input, which keeps changes minimal, but I'm not sure if this is the correct approach.
Does Chromium not support ISO 8601? I think that we should follow that format.
No, I tried inputting a date in ISO format, but the output was garbage (e.g. '2025-10-06' → '51006-02-02').
@whimboo I believe the accepted format is dependent on the user locale.
@Holo-xy I wonder if using locale overrides https://www.w3.org/TR/webdriver-bidi/#command-emulation-setLocaleOverride works around this issue? I imagine if you the locale is fixed, there could be no need for additional normalization?
@whimboo I believe the accepted format is dependent on the user locale.
I don't think so, as I tested with different locales (US, UK, CH, which cover the three formats) and it didn't seem to make a difference.