<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[173110] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/173110">173110</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-29 00:42:56 -0700 (Fri, 29 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtkcpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtkh">trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkScrollbarThemeGtkcpp">trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkScrollbarThemeGtkh">trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173109 => 173110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-29 07:39:13 UTC (rev 173109)
+++ trunk/Source/WebCore/ChangeLog        2014-08-29 07:42:56 UTC (rev 173110)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-08-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [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:
+
</ins><span class="cx"> 2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Merge RenderThemeGtk3.cpp into RenderThemeGtk.cpp and ScrollbarThemeGtk3.cpp intoScrollbarThemeGtk.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp (173109 => 173110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-08-29 07:39:13 UTC (rev 173109)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-08-29 07:42:56 UTC (rev 173110)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include &quot;RenderBox.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span><span class="cx"> #include &quot;RenderProgress.h&quot;
</span><ins>+#include &quot;ScrollbarThemeGtk.h&quot;
</ins><span class="cx"> #include &quot;StringTruncator.h&quot;
</span><span class="cx"> #include &quot;TimeRanges.h&quot;
</span><span class="cx"> #include &quot;UserAgentScripts.h&quot;
</span><span class="lines">@@ -140,6 +141,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (const auto&amp; styleContext : styleContextMap())
</span><span class="cx">         gtk_style_context_invalidate(styleContext.value.get());
</span><ins>+    static_cast&lt;ScrollbarThemeGtk*&gt;(ScrollbarTheme::theme())-&gt;themeChanged();
</ins><span class="cx">     Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -165,9 +167,7 @@
</span><span class="cx">     GtkWidgetPath* path = gtk_widget_path_new();
</span><span class="cx">     gtk_widget_path_append_type(path, widgetType);
</span><span class="cx"> 
</span><del>-    if (widgetType == GTK_TYPE_SCROLLBAR)
-        gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_SCROLLBAR);
-    else if (widgetType == GTK_TYPE_ENTRY)
</del><ins>+    if (widgetType == GTK_TYPE_ENTRY)
</ins><span class="cx">         gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_ENTRY);
</span><span class="cx">     else if (widgetType == GTK_TYPE_ARROW)
</span><span class="cx">         gtk_widget_path_iter_add_class(path, 0, &quot;arrow&quot;);
</span><span class="lines">@@ -197,11 +197,6 @@
</span><span class="cx">     return context.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GtkStyleContext* RenderThemeGtk::gtkScrollbarStyle()
-{
-    return getStyleContext(GTK_TYPE_SCROLLBAR);
-}
-
</del><span class="cx"> static GRefPtr&lt;GdkPixbuf&gt; getStockIconForWidgetType(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(iconName);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h (173109 => 173110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-08-29 07:39:13 UTC (rev 173109)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-08-29 07:42:56 UTC (rev 173110)
</span><span class="lines">@@ -100,8 +100,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    GtkStyleContext* gtkScrollbarStyle();
-
</del><span class="cx"> private:
</span><span class="cx">     RenderThemeGtk();
</span><span class="cx">     virtual ~RenderThemeGtk();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkScrollbarThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp (173109 => 173110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp        2014-08-29 07:39:13 UTC (rev 173109)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp        2014-08-29 07:42:56 UTC (rev 173110)
</span><span class="lines">@@ -28,11 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PlatformContextCairo.h&quot;
</span><span class="cx"> #include &quot;PlatformMouseEvent.h&quot;
</span><del>-#include &quot;RenderThemeGtk.h&quot;
</del><span class="cx"> #include &quot;ScrollView.h&quot;
</span><span class="cx"> #include &quot;Scrollbar.h&quot;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><ins>+#include &lt;wtf/gobject/GRefPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -163,22 +163,50 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef GTK_API_VERSION_2
</span><del>-static void gtkStyleChangedCallback(GtkWidget*, ScrollbarThemeGtk* scrollbarTheme)
</del><ins>+class ScrollbarStyleContext {
+    WTF_MAKE_NONCOPYABLE(ScrollbarStyleContext); WTF_MAKE_FAST_ALLOCATED;
+public:
+    ScrollbarStyleContext()
+        : m_context(adoptGRef(gtk_style_context_new()))
+    {
+        GtkWidgetPath* path = gtk_widget_path_new();
+        gtk_widget_path_append_type(path, GTK_TYPE_SCROLLBAR);
+        gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_SCROLLBAR);
+        gtk_style_context_set_path(m_context.get(), path);
+        gtk_widget_path_free(path);
+    }
+
+    ~ScrollbarStyleContext()
+    {
+    }
+
+    GtkStyleContext* context() const { return m_context.get(); }
+
+private:
+    GRefPtr&lt;GtkStyleContext&gt; m_context;
+};
+
+static GtkStyleContext* gtkScrollbarStyleContext()
</ins><span class="cx"> {
</span><del>-    scrollbarTheme-&gt;updateThemeProperties();
</del><ins>+    static NeverDestroyed&lt;ScrollbarStyleContext&gt; styleContext;
+    return styleContext.get().context();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollbarThemeGtk::ScrollbarThemeGtk()
</span><del>-    : m_context(static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get())-&gt;gtkScrollbarStyle())
</del><span class="cx"> {
</span><span class="cx">     updateThemeProperties();
</span><del>-    g_signal_connect(m_context, &quot;changed&quot;, G_CALLBACK(gtkStyleChangedCallback), this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollbarThemeGtk::themeChanged()
+{
+    gtk_style_context_invalidate(gtkScrollbarStyleContext());
+    updateThemeProperties();
+}
+
</ins><span class="cx"> void ScrollbarThemeGtk::updateThemeProperties()
</span><span class="cx"> {
</span><span class="cx">     gtk_style_context_get_style(
</span><del>-        m_context,
</del><ins>+        gtkScrollbarStyleContext(),
</ins><span class="cx">         &quot;min-slider-length&quot;, &amp;m_minThumbLength,
</span><span class="cx">         &quot;slider-width&quot;, &amp;m_thumbFatness,
</span><span class="cx">         &quot;trough-border&quot;, &amp;m_troughBorderWidth,
</span><span class="lines">@@ -259,55 +287,59 @@
</span><span class="cx">     if (m_troughUnderSteppers)
</span><span class="cx">         fullScrollbarRect = IntRect(scrollbar-&gt;x(), scrollbar-&gt;y(), scrollbar-&gt;width(), scrollbar-&gt;height());
</span><span class="cx"> 
</span><del>-    gtk_style_context_save(m_context);
</del><ins>+    GtkStyleContext* styleContext = gtkScrollbarStyleContext();
+    gtk_style_context_save(styleContext);
</ins><span class="cx"> 
</span><del>-    applyScrollbarStyleContextClasses(m_context, scrollbar-&gt;orientation());
-    gtk_style_context_add_class(m_context, GTK_STYLE_CLASS_TROUGH);
</del><ins>+    applyScrollbarStyleContextClasses(styleContext, scrollbar-&gt;orientation());
+    gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_TROUGH);
</ins><span class="cx"> 
</span><del>-    gtk_render_background(m_context, context-&gt;platformContext()-&gt;cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height());
-    gtk_render_frame(m_context, context-&gt;platformContext()-&gt;cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height());
</del><ins>+    gtk_render_background(styleContext, context-&gt;platformContext()-&gt;cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height());
+    gtk_render_frame(styleContext, context-&gt;platformContext()-&gt;cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height());
</ins><span class="cx"> 
</span><del>-    gtk_style_context_restore(m_context);
</del><ins>+    gtk_style_context_restore(styleContext);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
</span><span class="cx"> {
</span><del>-    gtk_style_context_save(m_context);
</del><ins>+    GtkStyleContext* styleContext = gtkScrollbarStyleContext();
+    gtk_style_context_save(styleContext);
</ins><span class="cx"> 
</span><del>-    applyScrollbarStyleContextClasses(m_context, scrollbar-&gt;orientation());
-    gtk_style_context_add_class(m_context, &quot;scrolled-window&quot;);
-    gtk_render_frame(m_context, context-&gt;platformContext()-&gt;cr(), scrollbar-&gt;x(), scrollbar-&gt;y(), scrollbar-&gt;width(), scrollbar-&gt;height());
</del><ins>+    applyScrollbarStyleContextClasses(styleContext, scrollbar-&gt;orientation());
+    gtk_style_context_add_class(styleContext, &quot;scrolled-window&quot;);
+    gtk_render_frame(styleContext, context-&gt;platformContext()-&gt;cr(), scrollbar-&gt;x(), scrollbar-&gt;y(), scrollbar-&gt;width(), scrollbar-&gt;height());
</ins><span class="cx"> 
</span><del>-    gtk_style_context_restore(m_context);
</del><ins>+    gtk_style_context_restore(styleContext);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect&amp; rect)
</span><span class="cx"> {
</span><del>-    gtk_style_context_save(m_context);
</del><ins>+    GtkStyleContext* styleContext = gtkScrollbarStyleContext();
+    gtk_style_context_save(styleContext);
</ins><span class="cx"> 
</span><span class="cx">     ScrollbarOrientation orientation = scrollbar-&gt;orientation();
</span><del>-    applyScrollbarStyleContextClasses(m_context, orientation);
-    gtk_style_context_add_class(m_context, GTK_STYLE_CLASS_SLIDER);
</del><ins>+    applyScrollbarStyleContextClasses(styleContext, orientation);
+    gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_SLIDER);
</ins><span class="cx"> 
</span><span class="cx">     guint flags = 0;
</span><span class="cx">     if (scrollbar-&gt;pressedPart() == ThumbPart)
</span><span class="cx">         flags |= GTK_STATE_FLAG_ACTIVE;
</span><span class="cx">     if (scrollbar-&gt;hoveredPart() == ThumbPart)
</span><span class="cx">         flags |= GTK_STATE_FLAG_PRELIGHT;
</span><del>-    gtk_style_context_set_state(m_context, static_cast&lt;GtkStateFlags&gt;(flags));
</del><ins>+    gtk_style_context_set_state(styleContext, static_cast&lt;GtkStateFlags&gt;(flags));
</ins><span class="cx"> 
</span><del>-    gtk_render_slider(m_context, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height(),
</del><ins>+    gtk_render_slider(styleContext, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height(),
</ins><span class="cx">         orientation == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL);
</span><span class="cx"> 
</span><del>-    gtk_style_context_restore(m_context);
</del><ins>+    gtk_style_context_restore(styleContext);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect&amp; rect, ScrollbarPart part)
</span><span class="cx"> {
</span><del>-    gtk_style_context_save(m_context);
</del><ins>+    GtkStyleContext* styleContext = gtkScrollbarStyleContext();
+    gtk_style_context_save(styleContext);
</ins><span class="cx"> 
</span><span class="cx">     ScrollbarOrientation orientation = scrollbar-&gt;orientation();
</span><del>-    applyScrollbarStyleContextClasses(m_context, orientation);
</del><ins>+    applyScrollbarStyleContextClasses(styleContext, orientation);
</ins><span class="cx"> 
</span><span class="cx">     guint flags = 0;
</span><span class="cx">     if ((BackButtonStartPart == part &amp;&amp; scrollbar-&gt;currentPos())
</span><span class="lines">@@ -320,14 +352,14 @@
</span><span class="cx">             flags |= GTK_STATE_FLAG_PRELIGHT;
</span><span class="cx">     } else
</span><span class="cx">         flags |= GTK_STATE_FLAG_INSENSITIVE;
</span><del>-    gtk_style_context_set_state(m_context, static_cast&lt;GtkStateFlags&gt;(flags));
</del><ins>+    gtk_style_context_set_state(styleContext, static_cast&lt;GtkStateFlags&gt;(flags));
</ins><span class="cx"> 
</span><del>-    gtk_style_context_add_class(m_context, GTK_STYLE_CLASS_BUTTON);
-    gtk_render_background(m_context, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height());
-    gtk_render_frame(m_context, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height());
</del><ins>+    gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_BUTTON);
+    gtk_render_background(styleContext, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height());
+    gtk_render_frame(styleContext, context-&gt;platformContext()-&gt;cr(), rect.x(), rect.y(), rect.width(), rect.height());
</ins><span class="cx"> 
</span><span class="cx">     gfloat arrowScaling;
</span><del>-    gtk_style_context_get_style(m_context, &quot;arrow-scaling&quot;, &amp;arrowScaling, nullptr);
</del><ins>+    gtk_style_context_get_style(styleContext, &quot;arrow-scaling&quot;, &amp;arrowScaling, nullptr);
</ins><span class="cx"> 
</span><span class="cx">     double arrowSize = std::min(rect.width(), rect.height()) * arrowScaling;
</span><span class="cx">     FloatPoint arrowPoint(
</span><span class="lines">@@ -336,7 +368,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (flags &amp; GTK_STATE_FLAG_ACTIVE) {
</span><span class="cx">         gint arrowDisplacementX, arrowDisplacementY;
</span><del>-        gtk_style_context_get_style(m_context, &quot;arrow-displacement-x&quot;, &amp;arrowDisplacementX, &quot;arrow-displacement-y&quot;, &amp;arrowDisplacementY, nullptr);
</del><ins>+        gtk_style_context_get_style(styleContext, &quot;arrow-displacement-x&quot;, &amp;arrowDisplacementX, &quot;arrow-displacement-y&quot;, &amp;arrowDisplacementY, nullptr);
</ins><span class="cx">         arrowPoint.move(arrowDisplacementX, arrowDisplacementY);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -346,9 +378,9 @@
</span><span class="cx">     else
</span><span class="cx">         angle = (part == ForwardButtonEndPart || part == ForwardButtonStartPart) ? G_PI / 2 : 3 * (G_PI / 2);
</span><span class="cx"> 
</span><del>-    gtk_render_arrow(m_context, context-&gt;platformContext()-&gt;cr(), angle, arrowPoint.x(), arrowPoint.y(), arrowSize);
</del><ins>+    gtk_render_arrow(styleContext, context-&gt;platformContext()-&gt;cr(), angle, arrowPoint.x(), arrowPoint.y(), arrowSize);
</ins><span class="cx"> 
</span><del>-    gtk_style_context_restore(m_context);
</del><ins>+    gtk_style_context_restore(styleContext);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScrollbarThemeGtk::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect&amp; damageRect)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkScrollbarThemeGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h (173109 => 173110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h        2014-08-29 07:39:13 UTC (rev 173109)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h        2014-08-29 07:42:56 UTC (rev 173110)
</span><span class="lines">@@ -59,13 +59,13 @@
</span><span class="cx">     // TODO: These are the default GTK+ values. At some point we should pull these from the theme itself.
</span><span class="cx">     virtual double initialAutoscrollTimerDelay() { return 0.20; }
</span><span class="cx">     virtual double autoscrollTimerDelay() { return 0.02; }
</span><del>-    void updateThemeProperties();
</del><ins>+    void themeChanged();
</ins><span class="cx">     void updateScrollbarsFrameThickness();
</span><span class="cx">     void registerScrollbar(ScrollbarThemeClient*);
</span><span class="cx">     void unregisterScrollbar(ScrollbarThemeClient*);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    GtkStyleContext* m_context;
</del><ins>+    void updateThemeProperties();
</ins><span class="cx"> 
</span><span class="cx">     int m_thumbFatness;
</span><span class="cx">     int m_troughBorderWidth;
</span></span></pre>
</div>
</div>

</body>
</html>