Bug 273975

Summary: [WPE][GTK] createNewPage in WebKitUIClient.cpp needs some hooking up of the API::PageConfiguration
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bugs-noreply
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on: 273993    
Bug Blocks:    

Description Michael Catanzaro 2024-05-09 15:30:38 PDT
On webkit-dev@, Alex writes:

"createNewPage in WebKitUIClient.cpp needs some hooking up of the API::PageConfiguration in a way I couldn’t figure out in the few minutes I looked at it.  This should be pretty straightforward to someone who knows the glib code better than I do."

I'm going to propose a pull request to unblock this, but I have a question. In webkitWebContextCreatePageForWebView, we need to take many settings from the related view's configuration, because this is an API guarantee. Presumably the new API::Configuration object is expected to match the related view, so it's probably not a problem, but this does mean we won't respect all of the values set in the API::Configuration in case they are different for some reason. Specifically:

    pageConfiguration->setProcessPool(context->priv->processPool.get());
    pageConfiguration->setPreferences(webkitSettingsGetPreferences(webkit_web_view_get_settings(webView)));
    pageConfiguration->setRelatedPage(relatedView ? &webkitWebViewGetPage(relatedView) : nullptr);
    pageConfiguration->setUserContentController(userContentManager ? webkitUserContentManagerGetUserContentControllerProxy(userContentManager) : nullptr);
    pageConfiguration->setControlledByAutomation(webkit_web_view_is_controlled_by_automation(webView));

All those will get overridden. I *assume* this is OK.
Comment 1 Michael Catanzaro 2024-05-09 15:37:36 PDT
Pull request: https://github.com/WebKit/WebKit/pull/28365
Comment 2 EWS 2024-05-16 16:59:19 PDT
Committed 278896@main (4f5aa1a1182d): <https://commits.webkit.org/278896@main>

Reviewed commits have been landed. Closing PR #28365 and removing active labels.