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

Add test case for ElementInternals validation customError #51039

Merged
merged 3 commits into from
Mar 2, 2025

Conversation

kyubisation
Copy link
Contributor

customError in ValidityState should only be true, if explicitly set. This is currently correct in Chromium and Firefox, but not WebKit.

`customError` in ValidityState should only be true, if explicitly set. This is currently correct in Chromium and Firefox, but not WebKit.
Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a correct change and worthwhile writing a test for, but I think it should be inside a separate, new, test() function. Having tests with lots of asserts is difficult to implement against, vs smaller individual tests.

@keithamus keithamus merged commit 7911ae1 into web-platform-tests:master Mar 2, 2025
19 checks passed
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 8, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
* WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme:
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 8, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 8, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 8, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 9, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
kyubisation added a commit to kyubisation/WebKit that referenced this pull request Mar 9, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by NOBODY (OOPS!).

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:
webkit-commit-queue pushed a commit to kyubisation/WebKit that referenced this pull request Mar 10, 2025
…g setValidity

https://bugs.webkit.org/show_bug.cgi?id=261432

Reviewed by Ryosuke Niwa.

The current implementation toggles customError when any validationMessage is
set, which works for native form elements, but breaks with ElementInternals.
This PR fixes this by overriding the customError check in FormAssociatedCustomElement.
(Test was added in web-platform-tests/wpt#51039)

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation-expected.txt
* Source/WebCore/html/FormAssociatedCustomElement.h:
* Source/WebCore/html/FormListedElement.h:

Canonical link: https://commits.webkit.org/291878@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants