[webkit-changes] [WebKit/WebKit] ae3642: [Remote Inspection] Add the ability to snapshot a ...

Wenson Hsieh noreply at github.com
Sun May 26 09:20:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ae3642d0a5304c0cf0955fc51c32b5103ec06b78
      https://github.com/WebKit/WebKit/commit/ae3642d0a5304c0cf0955fc51c32b5103ec06b78
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-05-26 (Sun, 26 May 2024)

  Changed paths:
    M Source/WebCore/page/ElementTargetingController.cpp
    M Source/WebCore/page/ElementTargetingController.h
    M Source/WebKit/UIProcess/API/APITargetedElementInfo.cpp
    M Source/WebKit/UIProcess/API/APITargetedElementInfo.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfo.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfo.mm
    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/Tests/WebKitCocoa/ElementTargetingTests.mm

  Log Message:
  -----------
  [Remote Inspection] Add the ability to snapshot a targeted element
https://bugs.webkit.org/show_bug.cgi?id=274718

Reviewed by Richard Robinson.

Add support for `-[_WKTargetedElementInfo takeSnapshotWithCompletionHandler:]`.
See below for more details.

Test: ElementTargeting.SnapshotElementWithVisibilityAdjustment

* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::ClearVisibilityAdjustmentForScope::ClearVisibilityAdjustmentForScope):
(WebCore::ClearVisibilityAdjustmentForScope::~ClearVisibilityAdjustmentForScope):

Add a RAII helper class to temporarily clear visibility adjustment flags from a given element.

(WebCore::ElementTargetingController::snapshotIgnoringVisibilityAdjustment):

Add a method to snapshot the element corresponding to the given identifiers, ignoring the effects of
visibility adjustment.

* Source/WebCore/page/ElementTargetingController.h:
* Source/WebKit/UIProcess/API/APITargetedElementInfo.cpp:
(API::TargetedElementInfo::takeSnapshot):
* Source/WebKit/UIProcess/API/APITargetedElementInfo.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfo.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfo.mm:
(-[_WKTargetedElementInfo takeSnapshotWithCompletionHandler:]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::takeSnapshotForTargetedElement):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeSnapshotForTargetedElement):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(-[_WKTargetedElementInfo takeSnapshot]):
(TestWebKitAPI::TEST(ElementTargeting, SnapshotElementWithVisibilityAdjustment)):

Add an API test to exercise the change.

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