Bug 152888 - [GTK] Cleanup RenderThemeGtk
Summary: [GTK] Cleanup RenderThemeGtk
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2016-01-08 06:04 PST by Carlos Garcia Campos
Modified: 2016-01-13 07:24 PST (History)
7 users (show)

See Also:


Attachments
Patch (74.75 KB, patch)
2016-01-08 06:15 PST, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-01-08 06:04:44 PST
Use a common path for GTK+ 3.19 and previous versions, simplifying the code and removing a lot of ifdefs.
Comment 1 Carlos Garcia Campos 2016-01-08 06:15:09 PST
Created attachment 268539 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-01-08 06:15:50 PST
This has been tested with GTK+ from current master and the internal jhbuild.
Comment 3 Michael Catanzaro 2016-01-08 08:23:26 PST
Comment on attachment 268539 [details]
Patch

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

Excellent patch; this worked quite well. Thanks for taking the time to work on this. Please watch the bots when this lands.

Looks like this also fixes bug #151502. Please close that when this lands.

Somewhat related: look at bug #152273.

> Source/WebCore/rendering/RenderThemeGtk.cpp:140
> +enum RenderThemePart {

I prefer to almost always use enum class in new code, both for safety, and also because I think it's more readable to use the RenderThemePart:: scope everywhere. But if you prefer to avoid the scoping, this is fine.

> Source/WebCore/rendering/RenderThemeGtk.cpp:379
> +    gtk_style_context_set_state(context.get(), gtk_widget_path_iter_get_state(path.get(), -1));

What's this for? Looks like a mistake. You have not set any state on the GtkWidgetPath. If this code actually does anything, then I would suspect that context might be inheriting its state from its parent... in which case it would be clearer to pass GTK_STATE_FLAGS_NONE.
Comment 4 Carlos Garcia Campos 2016-01-11 03:39:46 PST
Committed r194847: <http://trac.webkit.org/changeset/194847>
Comment 5 Mario Sanchez Prada 2016-01-13 05:51:34 PST
This patch broke accessibility/gtk/entry-and-password.html. See bug 153062.
Comment 6 Michael Catanzaro 2016-01-13 07:24:29 PST
This patch broke ~85 layout tests. Carlos fixed ~70 already so there are ~15 left to discover, including accessibility/gtk/entry-and-password.html. Thanks for helping Mario. :)