Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r173110, r193896 - [GTK] ScrollbarThemeGtk should not depend on…
… RenderThemeGtk https://bugs.webkit.org/show_bug.cgi?id=136338 Reviewed by Philippe Normand. Remove the dependency by creating the GtkStyleContext for the scrollbars in ScrollbarThemeGtk. * platform/gtk/RenderThemeGtk.cpp: (WebCore::gtkStyleChangedCallback): Call ScrollbarThemeGtk::themeChanged(). (WebCore::getStyleContext): Remove the scrollbar style context support. * platform/gtk/RenderThemeGtk.h: Remove gtkScrollbarStyle(). * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarStyleContext::ScrollbarStyleContext): Helper class to create the global GtkStyleContext for scrollbars. (WebCore::ScrollbarStyleContext::~ScrollbarStyleContext): (WebCore::ScrollbarStyleContext::context): (WebCore::gtkScrollbarStyleContext): (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Remove m_context initialization. (WebCore::ScrollbarThemeGtk::themeChanged): Invalidate the GtkStylecontext and call updateThemeProperties(). (WebCore::ScrollbarThemeGtk::updateThemeProperties): Use the global style context. (WebCore::ScrollbarThemeGtk::paintTrackBackground): Ditto. (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Ditto. (WebCore::ScrollbarThemeGtk::paintThumb): Ditto. (WebCore::ScrollbarThemeGtk::paintButton): Ditto. * platform/gtk/ScrollbarThemeGtk.h: [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. Remove the style context cache to simplify the code, drastically reduce the number of expensive save/restore operations performed on style contexts, and avoid unwanted side-effects in RenderThemeGtk::styleColor. This is also a speculative fix for improper button rendering with certain custom themes, and a simplification that will make it easier to fix bug #150550. This change does have performance implications, which I intend to check on the perf bot after landing to ensure that removing the cache does not have a significant negative impact on performance; I have no clue whether this will be a net performance win or loss. However, this is a bit tricky, because the bot is running GTK+ 3.16, whereas I expect save/restore might be much more expensive in GTK+ 3.20, and I do not want to make performance decisions except based on the latest GTK+ due to large changes in the implementation of
- Loading branch information