Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updatetime-local value sanitization removes leading zeroes for seconds #25493
Labels
Comments
|
Yes, the last field there should also have {:02}, sorry I didn't catch this when I was otherwise tweaking the time string code. |
|
{:02} is still wrong when there are millis; I've written a test to flex the various cases and I think I can pass them all by adding a branch for 0.0<second<10.0 that adds one leading zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the above example the leading zeroes for seconds are removed during sanitization, but they are required in valid datetime-local strings. This makes valueAsNumber fail, for example.
https://html.spec.whatwg.org/multipage/#valid-normalised-local-date-and-time-string
https://html.spec.whatwg.org/multipage/#valid-time-string
servo/components/script/dom/bindings/str.rs
Lines 469 to 484 in 63cb13f