[webkit-changes] [WebKit/WebKit] da7b72: [Remote Inspection] Add the ability to fetch all t...
Aspen Santos
noreply at github.com
Tue Oct 15 09:19:56 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: da7b72f3553442d570ba82fdcb4f187911c80999
https://github.com/WebKit/WebKit/commit/da7b72f3553442d570ba82fdcb4f187911c80999
Author: Aspen Santos <aspensantos99 at gmail.com>
Date: 2024-10-15 (Tue, 15 Oct 2024)
Changed paths:
M Source/WebCore/page/ElementTargetingController.cpp
M Source/WebCore/page/ElementTargetingController.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm
A Tools/TestWebKitAPI/Tests/WebKitCocoa/element-targeting-11.html
Log Message:
-----------
[Remote Inspection] Add the ability to fetch all targetable elements
https://bugs.webkit.org/show_bug.cgi?id=281173
rdar://135354335
Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.
Add the ability to fetch all targetable elements to collect highlight regions for accessibility
* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::ElementTargetingController::topologicallySortElementsHelper):
(WebCore::ElementTargetingController::topologicallySortElements):
- Topologically sort elements represented in a directed graph
(WebCore::ElementTargetingController::findAllTargets):
- Find all the targets in view by using the hitTestInterval parameter to findTargets in sections of that size
- Store the z relationships between the targets found in the dictionary elementIDToOccludedElementIDs
- Use the topologicallySortElements function on elementIDToOccludedElementIDs to get the z sorted elementIDs
- Return the targets for each elementID in z sorted order
* Source/WebCore/page/ElementTargetingController.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestAllTargetableElementsInfo:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestAllTargetableElements):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestAllTargetableElements):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(-[WKWebView allTargetableElementsWithHitTestInterval:]):
(TestWebKitAPI::TEST(ElementTargeting, RequestAllVisibleElements)):
- Add API test for [WKWebView _requestAllTargetableElementsInfo:completionHandler:]
* Tools/TestWebKitAPI/Tests/WebKitCocoa/element-targeting-11.html: Added.
- Add html file used in API test for [WKWebView _requestAllTargetableElementsInfo:completionHandler:]
Canonical link: https://commits.webkit.org/285200@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list