Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add better fallbacks to SelectElement.value #255
If a browser encounters a select element without any selected option element, it automatically pre-selects the first one. This change reflects that in FormElement.form_values.
Thanks, probably a good idea. Test is missing, though. And I'm also not entirely sure if that's the right place to change it. There isn't any defaulting in that method currently...
If you're fine with breaking existing usages, I'd also favor doing it in
To throw some standards at it, I think this sentence from the current W3C Recommendation applies:
The current W3C Proposed Recommendation also adds:
I think the
Regarding the case where there is no
We should thus return the empty string (opposed to
The code would be something like this (not tested):