[webkit-changes] [WebKit/WebKit] 194503: _WKContextMenuElementInfo should expose a _WKHitTe...

Jeff Miller noreply at github.com
Sat Jan 7 15:50:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 194503237785a3e8e926acfb1dbadb179700cd56
      https://github.com/WebKit/WebKit/commit/194503237785a3e8e926acfb1dbadb179700cd56
  Author: Jeff Miller <jeffm at apple.com>
  Date:   2023-01-07 (Sat, 07 Jan 2023)

  Changed paths:
    M Source/WebKit/Shared/API/APIObject.h
    M Source/WebKit/Shared/Cocoa/APIObject.mm
    A Source/WebKit/UIProcess/API/APIContextMenuElementInfoMac.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfo.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm
    A Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfoInternal.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm

  Log Message:
  -----------
  _WKContextMenuElementInfo should expose a _WKHitTestResult property
https://bugs.webkit.org/show_bug.cgi?id=250115
<rdar://103895210>

Reviewed by Alex Christensen.

* Source/WebKit/Shared/API/APIObject.h:
Added ContextMenuElementInfoMac.

* Source/WebKit/Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
Added support for _WKContextMenuElementInfo.

* Source/WebKit/UIProcess/API/APIContextMenuElementInfoMac.h:
Added. Unfortunately, there is already an iOS-only APIContextMenuElementInfo class and a
corresponding WKContextMenuElementInfo Objective-C class, so I had to use the Mac suffix here.

* Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
Declare a new hitTestResult property.

* Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
This now wraps API::ContextMenuElementInfoMac.
(-[_WKContextMenuElementInfo dealloc]):
(-[_WKContextMenuElementInfo hitTestResult]):
Create a _WKHitTestResult from WebHitTestResultData.
(-[_WKContextMenuElementInfo _apiObject]):

* Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfoInternal.h:
Added, wraps the API:APIContextMenuElementInfoMac class.

* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
Use the hit test result when creating the _WKContextMenuElementInfo.
Clean up some style checker errors.

* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
Added APIContextMenuElementInfoMac.h and _WKContextMenuElementInfoInternal.h.

* Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm:
(TestWebKitAPI::TEST):
Added a test that just verifies the _WKContextMenuElementInfo hitTestResult property is set.

Canonical link: https://commits.webkit.org/258624@main




More information about the webkit-changes mailing list