Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b7d3d40b4f0b12769021f7403a22a788669a1fc5
https://github.com/WebKit/WebKit/commit/b7d3d40b4f0b12769021f7403a22a788669a1fc5
Author: Wenson Hsieh <[email protected]>
Date: 2024-04-20 (Sat, 20 Apr 2024)
Changed paths:
M LayoutTests/fast/element-targeting/prefer-succinct-selectors-expected.txt
M LayoutTests/fast/element-targeting/prefer-succinct-selectors.html
A
LayoutTests/fast/element-targeting/target-element-selectors-using-attributes-expected.txt
A
LayoutTests/fast/element-targeting/target-element-selectors-using-attributes.html
M
LayoutTests/fast/element-targeting/target-iframe-above-nav-bar-expected.txt
M LayoutTests/fast/element-targeting/target-iframe-above-nav-bar.html
M Source/WebCore/page/ElementTargetingController.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm
Log Message:
-----------
[Remote Inspection] Selector-based element targeting heuristic should include
custom DOM attributes
https://bugs.webkit.org/show_bug.cgi?id=273038
rdar://126633838
Reviewed by Richard Robinson.
Make a couple more adjustments to the targeting heuristic, to make matching
more robust (and to
avoid falling back to n-th child selectors in more cases):
- Additionally surface unique selectors based on element attributes.
- Return early if we've already found unique selectors based on attributes
solely based on the
targeted element, to avoid the more expensive (and less stable) process of
recursively finding
parent- or child-relative selectors.
* LayoutTests/fast/element-targeting/prefer-succinct-selectors-expected.txt:
* LayoutTests/fast/element-targeting/prefer-succinct-selectors.html:
Rebaseline an existing layout test.
*
LayoutTests/fast/element-targeting/target-element-selectors-using-attributes-expected.txt:
Added.
*
LayoutTests/fast/element-targeting/target-element-selectors-using-attributes.html:
Added.
Add a new layout test to exercise the enhancements.
* LayoutTests/fast/element-targeting/target-iframe-above-nav-bar-expected.txt:
* LayoutTests/fast/element-targeting/target-iframe-above-nav-bar.html:
More rebaselining.
* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::querySelectorMatchesOneElement):
(WebCore::computeTagAndAttributeSelector):
(WebCore::computeTagAndClassSelector):
(WebCore::selectorForElementRecursive):
(WebCore::selectorsForTarget):
(WebCore::computeClassSelector): Deleted.
See above for more details.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(TestWebKitAPI::TEST(ElementTargeting, BasicElementTargeting)):
(TestWebKitAPI::TEST(ElementTargeting, NearbyOutOfFlowElements)):
(TestWebKitAPI::TEST(ElementTargeting, TargetInFlowElements)):
Rebaseline existing API tests.
Canonical link: https://commits.webkit.org/277790@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