Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement HTML5 form validation #11444

Closed
jdm opened this issue May 26, 2016 · 22 comments
Closed

Implement HTML5 form validation #11444

jdm opened this issue May 26, 2016 · 22 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented May 26, 2016

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.

@bobthekingofegypt
Copy link
Contributor

@bobthekingofegypt bobthekingofegypt commented Jun 6, 2016

If this is still free I'd like to take a look at it.

@jdm
Copy link
Member Author

@jdm jdm commented Jun 6, 2016

@jdm jdm added the C-assigned label Jun 6, 2016
@KiChjang
Copy link
Member

@KiChjang KiChjang commented Jun 17, 2016

@bobthekingofegypt Could we hear some feedback on how this is going so far? Any roadblocks that you've came across?

@bobthekingofegypt
Copy link
Contributor

@bobthekingofegypt bobthekingofegypt commented Jun 17, 2016

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.

@KiChjang
Copy link
Member

@KiChjang KiChjang commented Aug 1, 2016

@bobthekingofegypt Is this still being worked on?

@bobthekingofegypt
Copy link
Contributor

@bobthekingofegypt bobthekingofegypt commented Aug 2, 2016

@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.

@KiChjang KiChjang removed the C-assigned label Aug 3, 2016
@jdm jdm mentioned this issue Sep 20, 2016
4 of 4 tasks complete
@jdm
Copy link
Member Author

@jdm jdm commented Sep 20, 2016

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!

@ofekd
Copy link
Contributor

@ofekd ofekd commented Sep 21, 2016

@jdm Can I join the effort?

@jdm
Copy link
Member Author

@jdm jdm commented Sep 21, 2016

@ofekd Sorry, I think that would make evaluating their work for academic credit too complicated.

@jdm
Copy link
Member Author

@jdm jdm commented Sep 21, 2016

I can CC you on other issues you might be interested in, however!

@ghost
Copy link

@ghost ghost commented Dec 10, 2016

Hi @jdm
We are trying to implement the validation methods in validitystate.rs, do we have to check the HTML attribute for each element, such as "required", to make sure the element needs to be validated with the methods in validitystate.rs? Thank you.

@ghost
Copy link

@ghost ghost commented Dec 10, 2016

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?

@jdm
Copy link
Member Author

@jdm jdm commented Dec 11, 2016

Yes, please start from the second step.

@jdm
Copy link
Member Author

@jdm jdm commented Jan 27, 2017

Latest effort was in #14566. It stalled after the review, which pointed out some issues that need to be addressed.

@gpoesia
Copy link
Contributor

@gpoesia gpoesia commented Mar 29, 2017

Can I take this one? Is it fine to take the code from #14566, rebase it and start by addressing the comments?

@jdm
Copy link
Member Author

@jdm jdm commented Mar 30, 2017

@gpoesia That would be great!

@gpoesia
Copy link
Contributor

@gpoesia gpoesia commented Apr 23, 2017

@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?

@jdm
Copy link
Member Author

@jdm jdm commented Apr 23, 2017

Nope!

@pshaughn
Copy link
Member

@pshaughn pshaughn commented Dec 6, 2019

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.

@jdm jdm added this to To do in web-platform-test failures via automation Dec 6, 2019
@teapotd
Copy link
Contributor

@teapotd teapotd commented Dec 6, 2019

@highfive assign me

@highfive highfive added the C-assigned label Dec 6, 2019
@highfive
Copy link

@highfive highfive commented Dec 6, 2019

Hey @teapotd! Thanks for your interest in working on this issue. It's now assigned to you!

@pshaughn
Copy link
Member

@pshaughn pshaughn commented Feb 15, 2020

Interactions with #25705 exist; hopefully what I've written there is compatible with the direction this is going in.

bors-servo added a commit that referenced this issue Apr 1, 2020
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
bors-servo added a commit that referenced this issue Apr 1, 2020
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
bors-servo added a commit that referenced this issue Apr 1, 2020
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
bors-servo added a commit that referenced this issue Apr 2, 2020
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
@bors-servo bors-servo closed this in a651bad Apr 2, 2020
web-platform-test failures automation moved this from To do to Done Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

8 participants
You can’t perform that action at this time.