Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al.…
… should not clobber state of cached GtkStyleContexts https://bugs.webkit.org/show_bug.cgi?id=151533 Reviewed by Carlos Garcia Campos. platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc. are const functions intended only to return a color used for painting, but since r174929 they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This could cause theme colors returned by those GtkStyleContexts to change unexpectedly, depending on whether the state is explicitly set before each use, or whether the theme actually uses the states. This didn't cause any regression only because every place using these style contexts explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style context is not used anywhere else, and the GtkEntry style context is only used in paintTextField, which does set the state before use (and then reverts it using save/restore), so this cannot have broken anything in practice. But it's a landmine waiting for the next programmer to trip it. Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair. * rendering/RenderThemeGtk.cpp: (WebCore::styleColor): Canonical link: https://commits.webkit.org/169689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing with 30 additions and 2 deletions.