[webkit-changes] [WebKit/WebKit] 45a17f: Enable strict deserialization of DDActionContext b...

Alex Christensen noreply at github.com
Fri May 5 08:54:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 45a17f7bba614c5df5b50500bc5f16dcce1215ab
      https://github.com/WebKit/WebKit/commit/45a17f7bba614c5df5b50500bc5f16dcce1215ab
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-05-05 (Fri, 05 May 2023)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebCore/PAL/pal/mac/DataDetectorsSoftLink.h
    M Source/WebCore/PAL/pal/mac/DataDetectorsSoftLink.mm
    M Source/WebCore/PAL/pal/spi/mac/DataDetectorsSPI.h
    M Source/WebCore/editing/cocoa/DataDetection.h
    M Source/WebCore/editing/cocoa/DataDetection.mm
    M Source/WebKit/Platform/mac/MenuUtilities.mm
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
    M Source/WebKit/Shared/WebHitTestResultData.h
    M Source/WebKit/Shared/mac/WebHitTestResultPlatformData.serialization.in
    M Source/WebKit/UIProcess/API/APIHitTestResult.h
    M Source/WebKit/UIProcess/mac/WKImmediateActionController.h
    M Source/WebKit/UIProcess/mac/WKImmediateActionController.mm
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
    M Source/WebKit/WebProcess/WebPage/WebPageOverlay.h
    M Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm

  Log Message:
  -----------
  Enable strict deserialization of DDActionContext behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=256279
rdar://108866400

Reviewed by David Kilzer.

WebKit gets them from 3 places:

1. We allocate them ourselves.  I replaced this with allocation of DDSecureActionContexts.
2. We get them from calling contextForView:altMode:interactionStartedHandler:interactionChangedHandler:interactionStoppedHandler:
   on an existing DDActionContext.  This will give us a DDSecureActionContexts once rdar://108865826 is fixed.
3. We get them from WebUIDelegatePrivate's _webView:actionContextForHitTestResult:range: in WebKitLegacy.
   This is inconsequential because these will never be serialized across IPC, and DDActionContext and DDSecureActionContext
   behave the same except for their serialization code.  I added a cast in WebKitLegacy to keep it compiling, but ObjC will
   just do the right thing with all selectors given to the object.  Also, there's only one user of this delegate callback
   and it seems to be dead code.

I verified that adopting DDSecureActionContext causes the tests that used to have issues deserializing a DDActionContext
to no longer have the issues.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/PAL/pal/mac/DataDetectorsSoftLink.h:
* Source/WebCore/PAL/pal/mac/DataDetectorsSoftLink.mm:
* Source/WebCore/PAL/pal/spi/mac/DataDetectorsSPI.h:
* Source/WebCore/editing/cocoa/DataDetection.h:
* Source/WebCore/editing/cocoa/DataDetection.mm:
(WebCore::detectItem):
* Source/WebKit/Platform/mac/MenuUtilities.mm:
(WebKit::menuItemForTelephoneNumber):
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::haveSecureActionContext):
(IPC::shouldEnableStrictMode):
* Source/WebKit/Shared/WebHitTestResultData.h:
* Source/WebKit/Shared/mac/WebHitTestResultPlatformData.serialization.in:
* Source/WebKit/UIProcess/API/APIHitTestResult.h:
* Source/WebKit/UIProcess/mac/WKImmediateActionController.h:
* Source/WebKit/UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForDataDetectedLink]):
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
* Source/WebKit/WebProcess/WebPage/WebPageOverlay.h:
* Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForDataDetectedText]):

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




More information about the webkit-changes mailing list