[webkit-changes] [WebKit/WebKit] 7e5dfd: Add an option key to override the source app bundl...

Wenson Hsieh noreply at github.com
Fri Jan 19 15:36:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7e5dfd055f5e1d802a0075d868f69a6820484375
      https://github.com/WebKit/WebKit/commit/7e5dfd055f5e1d802a0075d868f69a6820484375
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-01-19 (Fri, 19 Jan 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm
    M Source/WebKit/UIProcess/API/Cocoa/NSAttributedStringPrivate.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewGetContents.mm

  Log Message:
  -----------
  Add an option key to override the source app bundle ID when creating attributed strings from HTML
https://bugs.webkit.org/show_bug.cgi?id=267781
rdar://119002423

Reviewed by Aditya Keerthi.

Add support for `_WKSourceApplicationBundleIdentifierOption`, which allows clients to indirectly set
a `-_sourceApplicationBundleIdentifier` on the website data store used when loading content when
serializing `NSAttributedString` from HTML or web archive data.

Test: WKWebView.AttributedStringWithSourceApplicationBundleID

* Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm:
(sourceApplicationBundleIdentifier):
(+[_WKAttributedStringWebViewCache configuration]):
(+[_WKAttributedStringWebViewCache maybeUpdateShouldAllowNetworkLoads:]):
(+[_WKAttributedStringWebViewCache maybeUpdateSourceApplicationBundleIdentifier:]):

Drive-by fix: ensure that we properly invalidate the globally cached configuration when going from
a source app bundle ID to no bundle ID, or when removing `_WKAllowNetworkLoadsOption`.

(+[_WKAttributedStringWebViewCache invalidateGlobalConfigurationIfNeeded:]):
* Source/WebKit/UIProcess/API/Cocoa/NSAttributedStringPrivate.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewGetContents.mm:

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




More information about the webkit-changes mailing list