Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Element::isFocusableWithoutResolvingFullStyle() inert checks do not u…
…pdate 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
- Loading branch information
Showing
12 changed files
with
113 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...nteractive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This is a dialog | ||
|
||
FAIL Test that removing dialog unblocks the document. assert_equals: expected false but got true | ||
|
||
PASS Test that removing dialog unblocks the document. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ests/imported/w3c/web-platform-tests/svg/struct/scripted/autofocus-attribute-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
PASS <a> should support autofocus | ||
PASS Renderable element with tabindex should support autofocus | ||
FAIL Never-rendered element with tabindex should not support autofocus promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'w.document.activeElement.tagName')" | ||
FAIL Never-rendered element with tabindex should not support autofocus assert_equals: expected "svg" but got "metadata" | ||
|
7 changes: 0 additions & 7 deletions
7
...emantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...ests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...form/mac-wk2/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Outside of inert container Inert button | ||
|
||
I'm editable | ||
I'm tabindexed. | ||
Link | ||
|
||
PASS Button outside of inert container is focusable. | ||
PASS Button with inert atribute is unfocusable. | ||
PASS All focusable elements inside inert subtree are unfocusable | ||
PASS Can get inert via property | ||
PASS Elements inside of inert subtrees return false when getting 'inert' | ||
FAIL Setting inert via property correctly modifies inert state assert_equals: expected true but got false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters