Bug 218114 - Remove Accelerated2dCanvasEnabled WebPreferences entry
Summary: Remove Accelerated2dCanvasEnabled WebPreferences entry
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-22 23:54 PDT by Zan Dobersek
Modified: 2020-11-12 01:06 PST (History)
7 users (show)

See Also:


Attachments
Patch (14.34 KB, patch)
2020-10-23 00:01 PDT, Zan Dobersek
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (15.04 KB, patch)
2020-10-23 00:25 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (15.71 KB, patch)
2020-10-23 01:16 PDT, Zan Dobersek
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (15.71 KB, patch)
2020-10-23 01:39 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2020-10-22 23:54:10 PDT
Remove Accelerated2dCanvasEnabled WebPreferences entry
Comment 1 Zan Dobersek 2020-10-23 00:01:25 PDT
Created attachment 412155 [details]
Patch
Comment 2 EWS Watchlist 2020-10-23 00:02:17 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 Zan Dobersek 2020-10-23 00:25:50 PDT
Created attachment 412156 [details]
Patch
Comment 4 Carlos Garcia Campos 2020-10-23 00:26:48 PDT
Comment on attachment 412155 [details]
Patch

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

> Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:3183
> -    return settings->priv->preferences->accelerated2dCanvasEnabled();
> +    return false;

We should add a g_warning here sayig the feature has been removes and this always return false.

> Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:-3196
> -
> -    WebKitSettingsPrivate* priv = settings->priv;
> -    if (priv->preferences->accelerated2dCanvasEnabled() == enabled)
> -        return;
> -
> -    priv->preferences->setAccelerated2dCanvasEnabled(enabled);
> -    g_object_notify(G_OBJECT(settings), "enable-accelerated-2d-canvas");

And here too, saying this does nothing now.

> Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:369
> +ALLOW_DEPRECATED_DECLARATIONS_BEGIN
> +    // Accelerated 2D canvas setting is deprecated and no-op.
> +    g_assert_false(webkit_settings_get_enable_accelerated_2d_canvas(settings));
> +    webkit_settings_set_enable_accelerated_2d_canvas(settings, TRUE);
> +    g_assert_false(webkit_settings_get_enable_accelerated_2d_canvas(settings));
> +ALLOW_DEPRECATED_DECLARATIONS_END

I think we can just remove the tests
Comment 5 Zan Dobersek 2020-10-23 01:16:13 PDT
Created attachment 412158 [details]
Patch
Comment 6 Zan Dobersek 2020-10-23 01:39:49 PDT
Created attachment 412163 [details]
Patch
Comment 7 Adrian Perez 2020-10-23 02:12:52 PDT
Comment on attachment 412163 [details]
Patch

LGTM. Please wait until the Mac/iOS EWS bots pass—I think the changes
look fine but it won't hurt to wait and be sure. I suppose touching the
code there in this case is non-controversial and we might not need
someone from Apple to rubber stamp the changes because the code which
implemented the feature is gone 🤔️
Comment 8 Zan Dobersek 2020-10-26 02:35:11 PDT
Comment on attachment 412163 [details]
Patch

Clearing flags on attachment: 412163

Committed r268965: <https://trac.webkit.org/changeset/268965>
Comment 9 Zan Dobersek 2020-10-26 02:35:15 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-10-26 02:36:18 PDT
<rdar://problem/70673860>
Comment 11 Michael Catanzaro 2020-10-27 13:51:11 PDT
Comment on attachment 412163 [details]
Patch

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

> Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:3183
> +    return false;

Nit: return FALSE 

Though it doesn't make any difference in this case, our code style is to use it everywhere with gboolean to be safe, because sometimes it does matter, e.g.:

// Good
g_object_set(settings, "enable-accelerated-2d-canvas", FALSE, NULL);

// Illegal access
g_object_set(settings, "enable-accelerated-2d-canvas", false, NULL);
Comment 12 Michael Catanzaro 2020-10-27 13:52:51 PDT
Eh, my example is wrong. :D I should have used g_object_get (there it really does matter).
Comment 13 Zan Dobersek 2020-11-12 01:06:54 PST
(In reply to Michael Catanzaro from comment #11)
> Comment on attachment 412163 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=412163&action=review
> 
> > Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:3183
> > +    return false;
> 
> Nit: return FALSE 
> 

Tweaked in r269723.
https://trac.webkit.org/changeset/269723