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 HTML5 form validation #11444
Comments
|
If this is still free I'd like to take a look at it. |
|
@bobthekingofegypt It is! |
|
@bobthekingofegypt Could we hear some feedback on how this is going so far? Any roadblocks that you've came across? |
|
Hello @KiChjang Not much to report yet, I had hoped to get some good progress when I was off at the end of last week but life got in the way. Hopefully I'll have some time this weekend. So far all I have really done is play around with whats was there and some ideas for how I want to lay things out. Took me a bit of time to work out why I couldn't use the atom macro for minlength but I eventually found the static string file in string-cache but no roadblocks yet. Also the 3 minute compilation time takes some getting used to. |
|
@bobthekingofegypt Is this still being worked on? |
|
@KiChjang Sorry, I just haven't had the time to make any proper progress yet. I should have probably stuck to smaller tasks, every time a week passes I have to just remind myself what I was doing instead of making progress. Feel free to reassign it if someone else wants to pick it up. |
|
This is intended to be worked on by a group of students this term. Please talk to me before anybody starts to work on it! |
|
@jdm Can I join the effort? |
|
@ofekd Sorry, I think that would make evaluating their work for academic credit too complicated. |
|
I can CC you on other issues you might be interested in, however! |
|
Hi @jdm |
|
I read the Form validation student project on Wiki, it seems that the last group has already finished the initial steps and the first subsequent step, should we start from the second one, add code to interactive_validation in the htmlformelement.rs file? |
|
Yes, please start from the second step. |
|
Latest effort was in #14566. It stalled after the review, which pointed out some issues that need to be addressed. |
|
Can I take this one? Is it fine to take the code from #14566, rebase it and start by addressing the comments? |
|
@gpoesia That would be great! |
|
@jdm is there currently any better way of reporting validation problems (step 4 in https://html.spec.whatwg.org/multipage/forms.html#interactively-validate-the-constraints) than writing to stdout? |
|
Nope! |
|
This is presumably why the 'invalid' case in WPT html/semantics/forms/form-submission-0/form-submission-algorithm.html isn't firing any oninvalid events. |
|
@highfive assign me |
|
Hey @teapotd! Thanks for your interest in working on this issue. It's now assigned to you! |
|
Interactions with #25705 exist; hopefully what I've written there is compatible with the direction this is going in. |
Form constraint validation It's almost done, there are few things remaining: - ~Range underflow, range overflow and step mismatch implementation require #25405~ - ~There are some test failures due to missing DOM parts (#25003)~ - ~`pattern` attribute uses JS regexp syntax. Currently I used regex crate, but it's probably incompatible. Should we use SpiderMonkey's regexp via jsapi?~ - Currently validation errors are reported using `println!`. Are there any better options? - ~["While the user interface is representing input that the user agent cannot convert to punycode, the control is suffering from bad input."](https://html.spec.whatwg.org/multipage/#e-mail-state-(type%3Demail)%3Asuffering-from-bad-input)~ r? @jdm --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11444 - [x] There are tests for these changes
Form constraint validation It's almost done, there are few things remaining: - ~Range underflow, range overflow and step mismatch implementation require #25405~ - ~There are some test failures due to missing DOM parts (#25003)~ - ~`pattern` attribute uses JS regexp syntax. Currently I used regex crate, but it's probably incompatible. Should we use SpiderMonkey's regexp via jsapi?~ - Currently validation errors are reported using `println!`. Are there any better options? - ~["While the user interface is representing input that the user agent cannot convert to punycode, the control is suffering from bad input."](https://html.spec.whatwg.org/multipage/#e-mail-state-(type%3Demail)%3Asuffering-from-bad-input)~ r? @jdm --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11444 - [x] There are tests for these changes
Form constraint validation It's almost done, there are few things remaining: - ~Range underflow, range overflow and step mismatch implementation require #25405~ - ~There are some test failures due to missing DOM parts (#25003)~ - ~`pattern` attribute uses JS regexp syntax. Currently I used regex crate, but it's probably incompatible. Should we use SpiderMonkey's regexp via jsapi?~ - Currently validation errors are reported using `println!`. Are there any better options? - ~["While the user interface is representing input that the user agent cannot convert to punycode, the control is suffering from bad input."](https://html.spec.whatwg.org/multipage/#e-mail-state-(type%3Demail)%3Asuffering-from-bad-input)~ r? @jdm --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11444 - [x] There are tests for these changes
Form constraint validation It's almost done, there are few things remaining: - ~Range underflow, range overflow and step mismatch implementation require #25405~ - ~There are some test failures due to missing DOM parts (#25003)~ - ~`pattern` attribute uses JS regexp syntax. Currently I used regex crate, but it's probably incompatible. Should we use SpiderMonkey's regexp via jsapi?~ - Currently validation errors are reported using `println!`. Are there any better options? - ~["While the user interface is representing input that the user agent cannot convert to punycode, the control is suffering from bad input."](https://html.spec.whatwg.org/multipage/#e-mail-state-(type%3Demail)%3Asuffering-from-bad-input)~ r? @jdm --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11444 - [x] There are tests for these changes
Specification: https://html.spec.whatwg.org/multipage/forms.html#constraints, https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api
#8747 laid the groundwork for this. #10843 is an attempt at implementing it that had a number of issues preventing it from being merged (see final comment).
Prerequisite for #10781.