Bug 257402 - API::PageConfiguration::copy() is error-prone
Summary: API::PageConfiguration::copy() is error-prone
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-26 16:42 PDT by Chris Dumez
Modified: 2023-11-23 23:32 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2023-05-26 16:42:31 PDT
API::PageConfiguration::copy() is error-prone as it is too easy to add a data member and forget to copy it in this function (Like in 264609@main).
Comment 1 Chris Dumez 2023-05-26 16:48:23 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14411
Comment 2 EWS 2023-05-30 11:46:36 PDT
Committed 264689@main (ecce6504d149): <https://commits.webkit.org/264689@main>

Reviewed commits have been landed. Closing PR #14411 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-05-30 11:47:19 PDT
<rdar://problem/110017496>
Comment 4 Olivier Blin 2023-11-23 23:32:30 PST
For reference, the autoplay disabling added in bug 184845 for GLib ports was not working on WPE before this change (but it was fine on GTK).

Before 264689@main from this bug, the following fields were not copied properly:
- m_additionalSupportedImageTypes
- m_defaultWebsitePolicies
- m_pageToCloneSessionStorageFrom

Since m_defaultWebsitePolicies was not copied, and WKWPE::View::View() uses  API::PageConfiguration::copy() to prepare
the WebView configuration for WPE, it missed the autoplay setting passed by the glib code, defaulting to WebsiteAutoplayPolicy::AllowWithoutSound / WEBKIT_AUTOPLAY_ALLOW_WITHOUT_SOUND.

As of WPE 2.42, the autoplay feature is now properly AllowWithoutSound by default.
Some embedded ports might have to change their application settings if they need autoplay to be enabled by default.