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

User interacted flag isn't always set on interactive submission #10066

Closed
emilio opened this issue Jan 16, 2024 · 5 comments · Fixed by #10067
Closed

User interacted flag isn't always set on interactive submission #10066

emilio opened this issue Jan 16, 2024 · 5 comments · Fixed by #10067

Comments

@emilio
Copy link
Contributor

emilio commented Jan 16, 2024

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/#concept-form-submit has a bunch of early returns before calling "constructing the entry list", which is what actually sets the "user interactive" flag.

@emilio
Copy link
Contributor Author

emilio commented Jan 16, 2024

That means that per spec:

<!doctype html>
<style>
:user-invalid {
  outline: 2px solid red;
}
</style>
<form>
  <input name="i3" required>
  <input name="i2" required>
  <button type=submit>Click</button>
</form>

Clicking shouldn't make the <input>s match :user-invalid, but that doesn't match engine behavior.

@emilio
Copy link
Contributor Author

emilio commented Jan 16, 2024

cc @nt1m @josepharhar @mfreed7, do you know what WebKit / Blink do here?

@emilio
Copy link
Contributor Author

emilio commented Jan 16, 2024

My understanding is that WebKit does this before step 5.3 of https://html.spec.whatwg.org/#form-submission-algorithm

emilio added a commit to emilio/html that referenced this issue Jan 16, 2024
Fixes whatwg#10066, matches WebKit and (soon) Gecko.
@josepharhar
Copy link
Contributor

So is the idea that clicking on the submit button should make all the form elements start matching :user-valid/:user-invalid whether the form submission succeeds or not? Is there a test for this?

@emilio
Copy link
Contributor Author

emilio commented Jan 17, 2024

Yes, tests fail without it afaict

annevk pushed a commit that referenced this issue Feb 2, 2024
Fixes #10066. This should match WebKit and (soon) Gecko.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants