-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Spec :user-invalid & :user-valid #9047
Conversation
4496680
to
d67b1bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a9180b9
to
13f6b4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this looks reasonable - just some small comments.
source
Outdated
@@ -58845,8 +58849,8 @@ fur | |||
|
|||
<p>The algorithm to <dfn id="constructing-the-form-data-set" export data-lt="constructing the | |||
entry list" data-x="constructing the entry list">construct the entry list</dfn> given a | |||
<var>form</var>, an optional <var>submitter</var>, and an optional <var>encoding</var>, is as | |||
follows. If not specified otherwise, <var>submitter</var> is null.</p> | |||
<var>form</var>, an optional <var>submitter</var>, an optional <var>resetUserInteracted</var> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does resetUserInteracted
need a default?
Actually, more important question: is resetUserInteracted
needed? It doesn't appear to be set anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I forgot to use it in the form submission algorithm
source
Outdated
defined <span>activation behavior</span>, and the user has changed the element's <span | ||
data-x="concept-fe-value">value</span> or its list of <span | ||
data-x="concept-input-type-file-selected">selected files</span> while the control was focused | ||
without committing that change (such that it is different to what it was when the control was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "committing that change" well defined? E.g. for an <input type=file>
I'm not sure where the commit happens - clicking ok on the file picker? Moving focus elsewhere?
I realize that this language was here before - just wondering if it needs clarification.
Side question: is there a plan to expand the WPT test suite for these pseudos? As I mentioned in web-platform-tests/interop#304, the current testing is quite light. |
There's an initial set of tests getting landed in web-platform-tests/wpt#39293 I'm hoping to write more whenever I have time. I'm off next week, but here's what planning to do:
|
Awesome, thank you! |
Hello, just checking in on this issue! Any progress on spec or WPTs? |
No progress on the spec unfortunately (hoping to get to it soon), but regarding WPT, web-platform-tests/wpt#39293 has since been merged, which should have basic WPT regarding behavior (not just parsing). |
Oh great, thanks for landing that. Feel free to cc me on the spec PR, but we'll get started on at least that basic behavior. |
We received some valuable feedback on the :user-invalid behavior on form submission, I'll be reworking a bit the form submission model. |
Checking in here. While the WPTs look reasonable for the normal use case behavior, the lack of a landed spec makes me a bit nervous about including this in Interop 2023. I previously closed web-platform-tests/interop#304, but I'm wondering if I should re-open it? And we can punt this item until Interop 2024, perhaps? |
13f6b4c
to
d3a7216
Compare
I just updated the spec PR to address the developer feedback received. |
d3a7216
to
cc8790d
Compare
I added some form submission & reset WPTs at: web-platform-tests/wpt#41378 |
@mfreed7 @josepharhar @annevk @emilio Can you please take a look at this PR? |
This PR defines FACE or buttons to be equivalent to |
030429b
to
864288a
Compare
https://bugs.webkit.org/show_bug.cgi?id=257988 rdar://110677832 Reviewed by Aditya Keerthi. Form submission should trigger user-validation styles, to do this, we set the user-interacted flag to true on form submission (but only initiated from user input). Form reset should reset form control user-interacted flags. This matches the WIP spec PR at: whatwg/html#9047 * LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html: * LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/selectors/user-invalid-expected.txt: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt: * Source/WebCore/html/FormAssociatedCustomElement.cpp: (WebCore::FormAssociatedCustomElement::reset): * Source/WebCore/html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submitIfPossible): * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::reset): * Source/WebCore/html/HTMLOutputElement.cpp: (WebCore::HTMLOutputElement::reset): * Source/WebCore/html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::reset): * Source/WebCore/html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::reset): Canonical link: https://commits.webkit.org/266702@main
I see the FACE point, but aren't all buttons barred from constraint validation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks pretty reasonable, modulo a few questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add Chromium to the commit message - we're supportive.
864288a
to
aaf0465
Compare
aaf0465
to
58f82bf
Compare
I've addressed all the feedback here, can you please take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a small fixup PR. Please take a look, and in particular at the new reset algorithm for the select element. The previous one was too confusing so I had to clean it up to make sense of what the new step was actually trying to do.
I have one question inline abut something I don't understand.
I pushed a couple nits. Looks good modulo the category comment above and a follow-up issue for custom elements. I guess for custom elements we want some kind of |
I filed #9639 for FACE |
Fixes #8452
(See WHATWG Working Mode: Changes for more details.)
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/input.html ( diff )
/interaction.html ( diff )
/semantics-other.html ( diff )