Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: faa2c01e654d1f7d5ebb35438a7df3bfcfb19a34
https://github.com/WebKit/WebKit/commit/faa2c01e654d1f7d5ebb35438a7df3bfcfb19a34
Author: Alex Christensen <[email protected]>
Date: 2025-09-16 (Tue, 16 Sep 2025)
Changed paths:
M Source/WebCore/bindings/js/DOMWrapperWorld.h
M Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
M Source/WebCore/bindings/js/JSDOMGlobalObject.h
M Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
M Source/WebCore/bindings/scripts/IDLAttributes.json
M Source/WebCore/bindings/scripts/preprocess-idls.pl
M Source/WebCore/loader/DocumentLoader.h
M Source/WebCore/page/LocalDOMWindow.cpp
M Source/WebCore/page/LocalDOMWindow.h
M Source/WebCore/page/WebKitJSHandle.idl
M Source/WebCore/page/WebKitNamespace.idl
M Source/WebKit/Shared/WebPageCreationParameters.h
M Source/WebKit/Shared/WebPageCreationParameters.serialization.in
M Source/WebKit/Shared/WebsitePoliciesData.cpp
M Source/WebKit/Shared/WebsitePoliciesData.h
M Source/WebKit/Shared/WebsitePoliciesData.serialization.in
M Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
M Source/WebKit/UIProcess/API/APIPageConfiguration.h
M Source/WebKit/UIProcess/API/APIWebsitePolicies.h
M Source/WebKit/UIProcess/API/C/WKPageConfigurationRef.cpp
M Source/WebKit/UIProcess/API/C/WKPageConfigurationRef.h
M Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp
M Source/WebKit/UIProcess/API/C/WKWebsitePolicies.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/JSHandle.mm
M Tools/WebKitTestRunner/TestController.cpp
Log Message:
-----------
Add WKWebpagePreferences SPI to allow JSHandle creation from the page world
for a navigation
https://bugs.webkit.org/show_bug.cgi?id=298832
rdar://160546140
Reviewed by Chris Dumez.
JSHandle creation is typically enabled for a WKContentWorld through
_WKContentWorldConfiguration.allowJSHandleCreation.
WebKitTestRunner needed it in the page world, so it was using
WKPageConfigurationSetAllowJSHandleInPageContentWorld.
However, we need to explore the possibility of using it for some navigations in
the page content world but not for others.
This introduces such a way to do that as part of rdar://160471423.
To do so, we needed to introduce a new scope for bindings to be available in.
EnabledForWorld is either always on or always
off in a certain world. EnabledForContext is either enabled for all worlds or
no worlds. For this we need something that
is on when the specific global object says it's on. For worlds where it's on,
it'll be always on. For global objects
where it's on, it'll be on in that normal world.
* Source/WebCore/bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::allowsJSHandleCreation const):
(WebCore::DOMWrapperWorld::setAllowsJSHandleCreation):
(WebCore::DOMWrapperWorld::allowJSHandleCreation const): Deleted.
(WebCore::DOMWrapperWorld::setAllowJSHandleCreation): Deleted.
* Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::allowsJSHandleCreation const):
* Source/WebCore/bindings/js/JSDOMGlobalObject.h:
* Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* Source/WebCore/bindings/scripts/IDLAttributes.json:
* Source/WebCore/bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::setAllowsJSHandleCreationInPageWorld):
(WebCore::DocumentLoader::allowsJSHandleCreationInPageWorld const):
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::shouldHaveWebKitNamespaceForWorld):
* Source/WebCore/page/LocalDOMWindow.h:
* Source/WebCore/page/WebKitJSHandle.idl:
* Source/WebCore/page/WebKitNamespace.idl:
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Source/WebKit/Shared/WebsitePoliciesData.h:
* Source/WebKit/Shared/WebsitePoliciesData.serialization.in:
* Source/WebKit/UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::setAllowJSHandleInPageContentWorld): Deleted.
(API::PageConfiguration::allowJSHandleInPageContentWorld const): Deleted.
* Source/WebKit/UIProcess/API/APIPageConfiguration.h:
* Source/WebKit/UIProcess/API/APIWebsitePolicies.h:
* Source/WebKit/UIProcess/API/C/WKPageConfigurationRef.cpp:
(WKPageConfigurationSetPortsForUpgradingInsecureSchemeForTesting):
(WKPageConfigurationSetAllowJSHandleInPageContentWorld): Deleted.
(WKPageConfigurationGetAllowJSHandleInPageContentWorld): Deleted.
* Source/WebKit/UIProcess/API/C/WKPageConfigurationRef.h:
* Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAllowsJSHandleCreationInPageWorld):
(WKWebsitePoliciesSetAllowsJSHandleCreationInPageWorld):
* Source/WebKit/UIProcess/API/C/WKWebsitePolicies.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _setAllowsJSHandleCreationInPageWorld:]):
(-[WKWebpagePreferences _allowsJSHandleCreationInPageWorld]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* Source/WebKit/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::InjectedBundleScriptWorld::setAllowJSHandleCreation):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_toolbarsAreVisible):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/JSHandle.mm:
(TestWebKitAPI::TEST(JSHandle, WebpagePreferences)):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):
Canonical link: https://commits.webkit.org/300037@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes