Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2831c74558e4fb1c5c6a4fe07cf4f1248ebc16c5
      
https://github.com/WebKit/WebKit/commit/2831c74558e4fb1c5c6a4fe07cf4f1248ebc16c5
  Author: Ben Nham <[email protected]>
  Date:   2026-05-07 (Thu, 07 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    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/WebKit/WebPage/WebPageTests.swift

  Log Message:
  -----------
  Add ability to clear content world
https://bugs.webkit.org/show_bug.cgi?id=314217
rdar://176381093

Reviewed by Ryosuke Niwa.

This adds a clearContentWorld call to WKWebView which clears all JS wrappers 
and global objects
within a content world. This is only meant to be used in specialized 
circumstances where the client
is confident that they are okay with having their world cleared (e.g. after 
running a stateless JS
function that touches many DOM nodes).

For the moment, this is only implemented for worlds with the node serialization 
capability, as it's
not meant to be widely used and is an interface with sharp edges.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _clearContentWorld:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::clearContentWorld):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::clearContentWorld):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/WebPageTests.swift:
(WebPageTests.clearContentWorld):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to