Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 06512bae0bd8f4c4cf65a959938eac4bb7290898
      
https://github.com/WebKit/WebKit/commit/06512bae0bd8f4c4cf65a959938eac4bb7290898
  Author: Wenson Hsieh <[email protected]>
  Date:   2024-04-10 (Wed, 10 Apr 2024)

  Changed paths:
    M Source/WebCore/page/ChromeClient.h
    M Source/WebCore/page/ElementTargetingController.cpp
    M Source/WebKit/UIProcess/API/APIUIClient.h
    M Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm
    M Tools/TestWebKitAPI/cocoa/TestUIDelegate.h
    M Tools/TestWebKitAPI/cocoa/TestUIDelegate.mm

  Log Message:
  -----------
  [Remote Inspection] Add a delegate method to notify clients of selector-based 
visibility adjustment
https://bugs.webkit.org/show_bug.cgi?id=272482

Reviewed by Aditya Keerthi.

Add a new UI delegate method to notify clients when selector-based visibility 
adjustment occurs. See
below for more details.

* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::didAdjustVisibilityWithSelectors):

Add a new `ChromeClient` method that eventually makes an IPC call out to the 
application process,
where it invokes the new UI delegate method.

* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::ElementTargetingController::applyVisibilityAdjustmentFromSelectors):

Call into the chrome client method here; also, make a couple of minor tweaks to 
ensure that we only
apply adjustment to content that is actually rendered (with a non-empty client 
rect).

* Source/WebKit/UIProcess/API/APIUIClient.h:
(API::UIClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didAdjustVisibilityWithSelectors):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(TestWebKitAPI::TEST(ElementTargeting, AdjustVisibilityFromSelectors)):
(TestWebKitAPI::TEST(ElementTargeting, AdjustVisibilityFromPseudoSelectors)):
* Tools/TestWebKitAPI/cocoa/TestUIDelegate.h:
* Tools/TestWebKitAPI/cocoa/TestUIDelegate.mm:
(-[TestUIDelegate _webView:didAdjustVisibilityWithSelectors:]):

Add test coverage by augmenting two existing API tests to also check that the 
new delegate method is
called, with the right selector strings.

Canonical link: https://commits.webkit.org/277353@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

Reply via email to