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 upImplement form resetting #3981
Implement form resetting #3981
Comments
|
See also the text at https://html.spec.whatwg.org/multipage/forms.html#reset-button-state-%28type=reset%29 for when to initiate a form reset. |
|
I'm making some progress on this. I can at least reset text inputs to their original state right now. |
|
I'll just make sure to leave my input element changes out of any pr I do until then, in that case. I like clicking on my buttons! |
|
Heh, sure. Let me know if you need help! :) |
|
Continuing from the discussion in #4002 (starting here)
My understanding so far is that the reset spec allows for the modification of content values (and thus the default values) by javascript (which is why it says to change the checkedness when the checked content attribute is added/removed), so the initial state isn't necessarily what we want. Actually, from what I've been able to make sense of so far, Servo's behavior in regards to check boxes is wrong (according to the spec). Currently, when we check/uncheck checkboxes with clicks, the checked content attribute gets added/removed (assuming I'm correct that after_set_attr and before_remove_attr are called during content attr changes (I also have a hunch that what we display on the screen is based on the content attrs and not our internal checkedness state)). And since the content attr is our point of reference, this means we have no default to fall back to on for reset. Here's some relevant spec links: I should also point out that while my understanding of this part of the servo code (not to mention the relevant specs) is definitely improving, there's a very good chance that I'm way off base. |
|
I would map the spec's "checkedness" to our |
|
So I guess following the spec (display based on our If that's the case, maybe I should just do a PR with the text input resets and leave the rest alone for now (still need to figure a couple things out and clean up first, though). |
|
Note: I'm pretty sure that that part of the spec is wrong (https://www.w3.org/Bugs/Public/show_bug.cgi?id=27446) Yeah, a SetFromParser enum would fix it. -----Original Message----- So I guess following the spec (display based on our checked property and not the attribute) breaks our current method of seeing a checkbox's state? |
|
Fixed in #4133 |
|
So this can be closed? |
|
Oops, forgot |
No description provided.