Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e002db6b59bb5a5e7861a47de7e752d8604a18a1
https://github.com/WebKit/WebKit/commit/e002db6b59bb5a5e7861a47de7e752d8604a18a1
Author: Wenson Hsieh <[email protected]>
Date: 2024-08-13 (Tue, 13 Aug 2024)
Changed paths:
M Source/WebCore/page/ElementTargetingController.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm
Log Message:
-----------
`-renderedText` should not be empty for targeted elements resolved using
compound selectors
https://bugs.webkit.org/show_bug.cgi?id=277968
rdar://133705519
Reviewed by Tim Horton.
Make a couple of adjustments to the element targeting heuristic:
1. Walk the ancestor chain and check `m_adjustedElements` to determine whether
an element is in a
visibility adjustment subtree. We do this instead of checking against the
element's ancestors'
`visibilityAdjustment()` states, because we may have temporarily reverted
visibility adjustments
when handling a targeting request.
2. Allow selector-based targeting to find elements that have already been
hidden by visibility
adjustment.
* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::selectorForElementRecursive):
(WebCore::siblingRelativeSelectorRecursive):
(WebCore::parentRelativeSelectorRecursive):
(WebCore::selectorsForTarget):
(WebCore::ElementTargetingController::targetedElementInfo):
(WebCore::shouldIgnoreExistingVisibilityAdjustments):
(WebCore::ElementTargetingController::extractTargets):
Ensure that `isInVisibilityAdjustmentSubtree` is correctly computed in the case
where we're
resolving a target inside of a visibility adjustment subtree using either
selector- or search-text-
based targeting.
(WebCore::targetedElementInfo): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(TestWebKitAPI::TEST(ElementTargeting, RequestElementsFromSelectors)):
Augment an existing test to exercise this change, by verifying that
`-renderedText` is equal to
"Bottom Right" for the bottom right hidden container.
Canonical link: https://commits.webkit.org/282163@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes