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

Regression(264098@main) HTMLFieldsetElement behavior for :enabled / :disabled CSS selectors is incorrect #14959

Merged

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Jun 14, 2023

a6d354d

Regression(264098@main) HTMLFieldsetElement behavior for :enabled / :disabled CSS selectors is incorrect
https://bugs.webkit.org/show_bug.cgi?id=258078

Reviewed by Tim Nguyen.

264098@main updated HTMLFieldSetElement::isDisabledFormControl() to return false
since a fieldset element can never be disabled per the specification.

This had the side effect of affecting our behavior for :enabled / :disabled CSS
selectors, which relied on this function. However, the behavior of these CSS
selectors shouldn't have changed since they rely on the "actually disabled" state,
not the "disabled" state [1].

There were two issues here, some of our CSS selector logic was relying on
isDisabledFormControl() instead of isActuallyDisabled(). Also, 264098@main
shouldn't have changed the value returned by isActuallyDisabled() for
HTMLFieldsetElements.

This was pointed out at:
- whatwg/html#5886 (comment)

[1] https://html.spec.whatwg.org/multipage/semantics-other.html#selector-enabled
[2] https://html.spec.whatwg.org/multipage/semantics-other.html#selector-disabled
[3] https://html.spec.whatwg.org/multipage/semantics-other.html#concept-element-disabled
[4] https://html.spec.whatwg.org/multipage/form-elements.html#concept-fieldset-disabled

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/enabled.html:
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesEnabledPseudoClass):
* Source/WebCore/html/HTMLElement.h:
* Source/WebCore/html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::isActuallyDisabled const):
* Source/WebCore/html/HTMLFieldSetElement.h:

Canonical link: https://commits.webkit.org/265166@main

a32e60b

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@cdumez cdumez self-assigned this Jun 14, 2023
@cdumez cdumez added the Forms For bugs specific to form elements (checkboxes, buttons, text fields, etc.) label Jun 14, 2023
@nt1m nt1m self-requested a review June 14, 2023 16:40
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 14, 2023
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Jun 14, 2023
@cdumez cdumez force-pushed the 258078_Fieldset_disabled_selector branch from 05db01b to a32e60b Compare June 14, 2023 18:29
@cdumez cdumez marked this pull request as ready for review June 14, 2023 20:56
@cdumez cdumez requested a review from rniwa as a code owner June 14, 2023 20:56
@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Jun 14, 2023
…disabled CSS selectors is incorrect

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

Reviewed by Tim Nguyen.

264098@main updated HTMLFieldSetElement::isDisabledFormControl() to return false
since a fieldset element can never be disabled per the specification.

This had the side effect of affecting our behavior for :enabled / :disabled CSS
selectors, which relied on this function. However, the behavior of these CSS
selectors shouldn't have changed since they rely on the "actually disabled" state,
not the "disabled" state [1].

There were two issues here, some of our CSS selector logic was relying on
isDisabledFormControl() instead of isActuallyDisabled(). Also, 264098@main
shouldn't have changed the value returned by isActuallyDisabled() for
HTMLFieldsetElements.

This was pointed out at:
- whatwg/html#5886 (comment)

[1] https://html.spec.whatwg.org/multipage/semantics-other.html#selector-enabled
[2] https://html.spec.whatwg.org/multipage/semantics-other.html#selector-disabled
[3] https://html.spec.whatwg.org/multipage/semantics-other.html#concept-element-disabled
[4] https://html.spec.whatwg.org/multipage/form-elements.html#concept-fieldset-disabled

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/enabled.html:
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesEnabledPseudoClass):
* Source/WebCore/html/HTMLElement.h:
* Source/WebCore/html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::isActuallyDisabled const):
* Source/WebCore/html/HTMLFieldSetElement.h:

Canonical link: https://commits.webkit.org/265166@main
@webkit-commit-queue
Copy link
Collaborator

Committed 265166@main (a6d354d): https://commits.webkit.org/265166@main

Reviewed commits have been landed. Closing PR #14959 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a6d354d into WebKit:main Jun 14, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Forms For bugs specific to form elements (checkboxes, buttons, text fields, etc.)
Projects
None yet
6 participants