Bug 217309

Summary: [GTK][WPE] Switch to unprefixed WebAudio API
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: WebKitGTKAssignee: Philippe Normand <pnormand>
Status: RESOLVED INVALID    
Severity: Normal CC: aperez, berto, bugs-noreply, cgarcia, ews-watchlist, gustavo, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch aperez: review-

Description Philippe Normand 2020-10-05 03:04:43 PDT
We should enable modernUnprefixedWebAudioEnabled when our web-audio websetting is enabled.
Comment 1 Philippe Normand 2020-10-06 06:53:36 PDT
Created attachment 410632 [details]
Patch
Comment 2 EWS Watchlist 2020-10-06 06:54:15 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Sam Weinig 2020-10-06 08:14:14 PDT
Comment on attachment 410632 [details]
Patch

This should ideally be done by setting a difference default value in WebPreferencesExperimental.yaml for ModernUnprefixedWebAudioEnabled.
Comment 4 Philippe Normand 2020-10-06 10:13:35 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 410632 [details]
> Patch
> 
> This should ideally be done by setting a difference default value in
> WebPreferencesExperimental.yaml for ModernUnprefixedWebAudioEnabled.

That would affect all ports though?

I went for a WPE/GTK specific change for now, I'm not sure what the plan is for the Apple ports regarding the default value of this setting.
Comment 5 Adrian Perez 2020-10-06 10:14:42 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 410632 [details]
> Patch
> 
> This should ideally be done by setting a difference default value in
> WebPreferencesExperimental.yaml for ModernUnprefixedWebAudioEnabled.

Wouldn't that change the setting for all the ports? The intention here
(IIUC) is to set it only for the GTK and WPE ports 🤔️
Comment 6 Sam Weinig 2020-10-06 12:02:13 PDT
(In reply to Adrian Perez from comment #5)
> (In reply to Sam Weinig from comment #3)
> > Comment on attachment 410632 [details]
> > Patch
> > 
> > This should ideally be done by setting a difference default value in
> > WebPreferencesExperimental.yaml for ModernUnprefixedWebAudioEnabled.
> 
> Wouldn't that change the setting for all the ports? The intention here
> (IIUC) is to set it only for the GTK and WPE ports 🤔️

The WebPreferences*.yaml file supports per-port configuration of defaults. You can just specify something like:

    WebKit:
      "PLATFORM(GTK) || PLATFORM(WPE)": true
      default: false

That said, looking at the current definition of ModernUnprefixedWebAudioEnabled, it looks like it is on by default for all platforms now. Are you sure this change is necessary?
Comment 7 Adrian Perez 2020-10-06 13:04:26 PDT
Comment on attachment 410632 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410632&action=review

> Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:2742
> +    priv->preferences->setModernUnprefixedWebAudioEnabled(enabled);

This should be unneeded, as pointed by Sam there is the following in
“Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml”:

  ModernUnprefixedWebAudioEnabled:
    type: bool
    humanReadableName: "Modern WebAudio API"
    humanReadableDescription: "Modern and unprefixed WebAudio API"
    condition: ENABLE(WEB_AUDIO)
    defaultValue:
      WebKitLegacy:
        "PLATFORM(IOS_FAMILY)" : true
        default: false
      WebKit:
        default: true

Note how this is enabled by default :)