[webkit-changes] [WebKit/WebKit] 2b519f: Element::isFocusableWithoutResolvingFullStyle() in...

Antti Koivisto noreply at github.com
Sat Nov 12 02:59:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2b519ff97e74aa11c104cfb2dcb3d697db8d2a49
      https://github.com/WebKit/WebKit/commit/2b519ff97e74aa11c104cfb2dcb3d697db8d2a49
  Author: Antti Koivisto <antti at apple.com>
  Date:   2022-11-12 (Sat, 12 Nov 2022)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/editing/style/apply-style-atomic-expected.txt
    M LayoutTests/editing/style/apply-style-atomic-live-range-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/autofocus-attribute-expected.txt
    R LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt
    R LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt
    A LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable-expected.txt
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h

  Log Message:
  -----------
  Element::isFocusableWithoutResolvingFullStyle() inert checks do not update right away
https://bugs.webkit.org/show_bug.cgi?id=239006
rdar://91485677

Reviewed by Alan Baradlay.

The code for resolving computed style in non-rendered subtree fails to take invalid
ancestors into account. In this case the effective inertness (a fake property)
fails to inherit from the document element.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt: Removed.
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable-expected.txt:

imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable.html is now passing except on Mac WK2 for some reason.

* LayoutTests/editing/style/apply-style-atomic-expected.txt:
* LayoutTests/editing/style/apply-style-atomic-live-range-expected.txt:

These results now correctly include <progress> inside the link.

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/autofocus-attribute-expected.txt:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setFocusedElement):

Focusability may depend on :focus-within matching as if the focus was already set.
Set it tentatively before testing. This is tested in
imported/w3c/web-platform-tests/css/selectors/focus-within-010.html

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setHasTentativeFocus):
(WebCore::Element::resolveComputedStyle):

This failed to check if any ancestor has invalid computed style. Due to inheritance that can affect the result.

(WebCore::Element::isFocusableWithoutResolvingFullStyle const):

All display:none checks are now done in resolveComputedStyle as it needs to traverse to the root anyway.

(WebCore::Element::hasValidStyle const): Deleted.
* Source/WebCore/dom/Element.h:

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




More information about the webkit-changes mailing list