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 upImprove spec compliance of validity check #27133
Comments
|
@highfive assign me |
|
Hey @muodov! Thanks for your interest in working on this issue. It's now assigned to you! |
|
Turns out, this is quite a recent change in HTML spec. The Links:
The validation methods ( All in all, it seems like I will just need to remove the line and enable this test :) |
|
Ok, thanks for looking into this, good research!
Re this, doesn't |
Do not fire `invalid` event on form elements This is a follow-up to my [previous PR](#27100) suggested by @gterzian. `invalid` event on the `<form>` element has been [recently removed](whatwg/html#4626) from the spec. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27133 <!-- Either: --> - [x] [WPT test](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/historical.window.js) marked as passing
|
@gterzian it took me some time to figure it out, but checkValidity() in "The constraint validation API" has nothing to do with the checkValidity() of the form element. |
|
Ah ok, so those I was referring to are about form controls, not the form element, as you already had pointed out. Thanks! |
This line https://github.com/servo/servo/pull/27100/files#diff-db2031d1f23ecf1a921fc100cfed753dR677
appears incorrect, since the spec only says to fire events on the fields that are invalid, via step 6.1 of https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#statically-validate-the-constraints, which is called into by https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-submit
An event is fired on the form element as a whole only as part of the "check validity steps", and those are called into from other places(for example the
checkValiditymethod).So the implementation of
checkValidatycould also be updated to actually fire an event.see
components/script/dom/htmlformelement.rs.