<!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>[173059] 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/173059">173059</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-28 02:13:58 -0700 (Thu, 28 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Remove support for GTK+2 theme rendering
https://bugs.webkit.org/show_bug.cgi?id=136285

Reviewed by Philippe Normand.

GTK+2 is only used by the plugin process that doesn't need to
render html controls themed. Since the theme files are still
built for WebCorePlatformGTK2, we need to provide dummy
implementations for the pure virtual methods when
GTK_API_VERSION_2 is defined.

* PlatformGTK.cmake: Remove deleted files from compilation.
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::create):
(WebCore::RenderTheme::themeForPage):
(WebCore::getScreenDPI):
(WebCore::RenderThemeGtk::systemFont):
(WebCore::RenderThemeGtk::sliderTickSize):
(WebCore::RenderThemeGtk::sliderTickOffsetFromTrackCenter):
(WebCore::RenderThemeGtk::getScreenDPI): Deleted.
* platform/gtk/RenderThemeGtk.h:
* platform/gtk/RenderThemeGtk2.cpp: Removed.
* platform/gtk/RenderThemeGtk3.cpp:
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::hasThumb):
(WebCore::ScrollbarThemeGtk::backButtonRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::registerScrollbar):
(WebCore::ScrollbarThemeGtk::unregisterScrollbar):
(WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
* platform/gtk/ScrollbarThemeGtk.h:
* platform/gtk/ScrollbarThemeGtk2.cpp: Removed.
* platform/gtk/WidgetRenderingContext.cpp: Removed.
* platform/gtk/WidgetRenderingContext.h: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</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="#trunkSourceWebCoreplatformgtkRenderThemeGtk3cpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp</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>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtk2cpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkScrollbarThemeGtk2cpp">trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkWidgetRenderingContextcpp">trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkWidgetRenderingContexth">trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/ChangeLog        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Remove support for GTK+2 theme rendering
+        https://bugs.webkit.org/show_bug.cgi?id=136285
+
+        Reviewed by Philippe Normand.
+
+        GTK+2 is only used by the plugin process that doesn't need to
+        render html controls themed. Since the theme files are still
+        built for WebCorePlatformGTK2, we need to provide dummy
+        implementations for the pure virtual methods when
+        GTK_API_VERSION_2 is defined.
+
+        * PlatformGTK.cmake: Remove deleted files from compilation.
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::create):
+        (WebCore::RenderTheme::themeForPage):
+        (WebCore::getScreenDPI):
+        (WebCore::RenderThemeGtk::systemFont):
+        (WebCore::RenderThemeGtk::sliderTickSize):
+        (WebCore::RenderThemeGtk::sliderTickOffsetFromTrackCenter):
+        (WebCore::RenderThemeGtk::getScreenDPI): Deleted.
+        * platform/gtk/RenderThemeGtk.h:
+        * platform/gtk/RenderThemeGtk2.cpp: Removed.
+        * platform/gtk/RenderThemeGtk3.cpp:
+        * platform/gtk/ScrollbarThemeGtk.cpp:
+        (WebCore::ScrollbarThemeGtk::hasThumb):
+        (WebCore::ScrollbarThemeGtk::backButtonRect):
+        (WebCore::ScrollbarThemeGtk::forwardButtonRect):
+        (WebCore::ScrollbarThemeGtk::trackRect):
+        (WebCore::ScrollbarThemeGtk::registerScrollbar):
+        (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
+        (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
+        * platform/gtk/ScrollbarThemeGtk.h:
+        * platform/gtk/ScrollbarThemeGtk2.cpp: Removed.
+        * platform/gtk/WidgetRenderingContext.cpp: Removed.
+        * platform/gtk/WidgetRenderingContext.h: Removed.
+
</ins><span class="cx"> 2014-08-28  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed GTK build fix for the Wayland windowing target after r173052.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -239,10 +239,8 @@
</span><span class="cx">     platform/gtk/PlatformWheelEventGtk.cpp
</span><span class="cx">     platform/gtk/RedirectedXCompositeWindow.cpp
</span><span class="cx">     platform/gtk/RenderThemeGtk.cpp
</span><del>-    platform/gtk/RenderThemeGtk2.cpp
</del><span class="cx">     platform/gtk/RenderThemeGtk3.cpp
</span><span class="cx">     platform/gtk/ScrollbarThemeGtk.cpp
</span><del>-    platform/gtk/ScrollbarThemeGtk2.cpp
</del><span class="cx">     platform/gtk/ScrollbarThemeGtk3.cpp
</span><span class="cx">     platform/gtk/SharedBufferGtk.cpp
</span><span class="cx">     platform/gtk/SharedTimerGtk.cpp
</span><span class="lines">@@ -252,7 +250,6 @@
</span><span class="cx">     platform/gtk/WebKitAuthenticationWidget.cpp
</span><span class="cx">     platform/gtk/WidgetBackingStoreGtkX11.cpp
</span><span class="cx">     platform/gtk/WidgetGtk.cpp
</span><del>-    platform/gtk/WidgetRenderingContext.cpp
</del><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> if (WTF_USE_GEOCLUE2)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -50,12 +50,82 @@
</span><span class="cx"> #include &lt;gdk/gdk.h&gt;
</span><span class="cx"> #include &lt;glib.h&gt;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><ins>+#include &lt;wtf/gobject/GRefPtr.h&gt;
</ins><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;RenderTheme&gt; RenderThemeGtk::create()
+{
+    return adoptRef(new RenderThemeGtk());
+}
+
+PassRefPtr&lt;RenderTheme&gt; RenderTheme::themeForPage(Page*)
+{
+    static RenderTheme* rt = RenderThemeGtk::create().leakRef();
+    return rt;
+}
+
+static double getScreenDPI()
+{
+    // FIXME: Really this should be the widget's screen.
+    GdkScreen* screen = gdk_screen_get_default();
+    if (!screen)
+        return 96; // Default to 96 DPI.
+
+    float dpi = gdk_screen_get_resolution(screen);
+    if (dpi &lt;= 0)
+        return 96;
+    return dpi;
+}
+
+void RenderThemeGtk::systemFont(CSSValueID, FontDescription&amp; fontDescription) const
+{
+    GtkSettings* settings = gtk_settings_get_default();
+    if (!settings)
+        return;
+
+    // This will be a font selection string like &quot;Sans 10&quot; so we cannot use it as the family name.
+    GUniqueOutPtr&lt;gchar&gt; fontName;
+    g_object_get(settings, &quot;gtk-font-name&quot;, &amp;fontName.outPtr(), NULL);
+
+    PangoFontDescription* pangoDescription = pango_font_description_from_string(fontName.get());
+    if (!pangoDescription)
+        return;
+
+    fontDescription.setOneFamily(pango_font_description_get_family(pangoDescription));
+
+    int size = pango_font_description_get_size(pangoDescription) / PANGO_SCALE;
+    // If the size of the font is in points, we need to convert it to pixels.
+    if (!pango_font_description_get_size_is_absolute(pangoDescription))
+        size = size * (getScreenDPI() / 72.0);
+
+    fontDescription.setSpecifiedSize(size);
+    fontDescription.setIsAbsoluteSize(true);
+    fontDescription.setGenericFamily(FontDescription::NoFamily);
+    fontDescription.setWeight(FontWeightNormal);
+    fontDescription.setItalic(false);
+    pango_font_description_free(pangoDescription);
+}
+
+#if ENABLE(DATALIST_ELEMENT)
+IntSize RenderThemeGtk::sliderTickSize() const
+{
+    // FIXME: We need to set this to the size of one tick mark.
+    return IntSize(0, 0);
+}
+
+int RenderThemeGtk::sliderTickOffsetFromTrackCenter() const
+{
+    // FIXME: We need to set this to the position of the tick marks.
+    return 0;
+}
+#endif
+
+#ifndef GTK_API_VERSION_2
+
</ins><span class="cx"> // This would be a static method, except that forward declaring GType is tricky, since its
</span><span class="cx"> // definition depends on including glib.h, negating the benefit of using a forward declaration.
</span><span class="cx"> extern GRefPtr&lt;GdkPixbuf&gt; getStockIconForWidgetType(GType, const char* iconName, gint direction, gint state, gint iconSize);
</span><span class="lines">@@ -121,17 +191,6 @@
</span><span class="cx">     return element-&gt;classNames().contains(className);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;RenderTheme&gt; RenderThemeGtk::create()
-{
-    return adoptRef(new RenderThemeGtk());
-}
-
-PassRefPtr&lt;RenderTheme&gt; RenderTheme::themeForPage(Page*)
-{
-    static RenderTheme* rt = RenderThemeGtk::create().leakRef();
-    return rt;
-}
-
</del><span class="cx"> RenderThemeGtk::RenderThemeGtk()
</span><span class="cx">     : m_panelColor(Color::white)
</span><span class="cx">     , m_sliderColor(Color::white)
</span><span class="lines">@@ -190,7 +249,7 @@
</span><span class="cx">     return RenderTheme::baselinePosition(o);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// This is used in RenderThemeGtk2 and RenderThemeGtk3. Normally, it would be in
</del><ins>+// This is used in RenderThemeGtk3. Normally, it would be in
</ins><span class="cx"> // the RenderThemeGtk header (perhaps as a static method), but we want to avoid
</span><span class="cx"> // having to include GTK+ headers only for the GtkTextDirection enum.
</span><span class="cx"> GtkTextDirection gtkTextDirection(TextDirection direction)
</span><span class="lines">@@ -437,48 +496,6 @@
</span><span class="cx">     return time / 2000.;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double RenderThemeGtk::getScreenDPI()
-{
-    // FIXME: Really this should be the widget's screen.
-    GdkScreen* screen = gdk_screen_get_default();
-    if (!screen)
-        return 96; // Default to 96 DPI.
-
-    float dpi = gdk_screen_get_resolution(screen);
-    if (dpi &lt;= 0)
-        return 96;
-    return dpi;
-}
-
-void RenderThemeGtk::systemFont(CSSValueID, FontDescription&amp; fontDescription) const
-{
-    GtkSettings* settings = gtk_settings_get_default();
-    if (!settings)
-        return;
-
-    // This will be a font selection string like &quot;Sans 10&quot; so we cannot use it as the family name.
-    GUniqueOutPtr&lt;gchar&gt; fontName;
-    g_object_get(settings, &quot;gtk-font-name&quot;, &amp;fontName.outPtr(), NULL);
-
-    PangoFontDescription* pangoDescription = pango_font_description_from_string(fontName.get());
-    if (!pangoDescription)
-        return;
-
-    fontDescription.setOneFamily(pango_font_description_get_family(pangoDescription));
-
-    int size = pango_font_description_get_size(pangoDescription) / PANGO_SCALE;
-    // If the size of the font is in points, we need to convert it to pixels.
-    if (!pango_font_description_get_size_is_absolute(pangoDescription))
-        size = size * (getScreenDPI() / 72.0);
-
-    fontDescription.setSpecifiedSize(size);
-    fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::NoFamily);
-    fontDescription.setWeight(FontWeightNormal);
-    fontDescription.setItalic(false);
-    pango_font_description_free(pangoDescription);
-}
-
</del><span class="cx"> void RenderThemeGtk::platformColorsDidChange()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="lines">@@ -739,20 +756,6 @@
</span><span class="cx">     return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(DATALIST_ELEMENT)
-IntSize RenderThemeGtk::sliderTickSize() const
-{
-    // FIXME: We need to set this to the size of one tick mark.
-    return IntSize(0, 0);
-}
-
-int RenderThemeGtk::sliderTickOffsetFromTrackCenter() const
-{
-    // FIXME: We need to set this to the position of the tick marks.
-    return 0;
-}
-#endif
-
</del><span class="cx"> String RenderThemeGtk::mediaControlsScript()
</span><span class="cx"> {
</span><span class="cx">     StringBuilder scriptBuilder;
</span><span class="lines">@@ -761,4 +764,6 @@
</span><span class="cx">     scriptBuilder.append(mediaControlsGtkJavaScript, sizeof(mediaControlsGtkJavaScript));
</span><span class="cx">     return scriptBuilder.toString();
</span><span class="cx"> }
</span><ins>+
+#endif // GTK_API_VERSION_2
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -28,21 +28,27 @@
</span><span class="cx"> #ifndef RenderThemeGtk_h
</span><span class="cx"> #define RenderThemeGtk_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/gobject/GRefPtr.h&gt;
</del><span class="cx"> #include &quot;RenderTheme.h&quot;
</span><span class="cx"> 
</span><del>-typedef struct _GdkColormap GdkColormap;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class RenderThemeGtk final : public RenderTheme {
</span><del>-private:
-    RenderThemeGtk();
-    virtual ~RenderThemeGtk();
-
</del><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;RenderTheme&gt; create();
</span><span class="cx"> 
</span><ins>+    // System fonts.
+    virtual void systemFont(CSSValueID, FontDescription&amp;) const override;
+
+#if ENABLE(DATALIST_ELEMENT)
+    // Returns size of one slider tick mark for a horizontal track.
+    // For vertical tracks we rotate it and use it. i.e. Width is always length along the track.
+    virtual IntSize sliderTickSize() const override;
+    // Returns the distance of slider tick origin from the slider track center.
+    virtual int sliderTickOffsetFromTrackCenter() const override;
+#endif
+
+#ifndef GTK_API_VERSION_2
+
</ins><span class="cx">     // A method asking if the theme's controls actually care about redrawing when hovered.
</span><span class="cx">     virtual bool supportsHover(const RenderStyle&amp;) const override { return true; }
</span><span class="cx"> 
</span><span class="lines">@@ -78,8 +84,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void platformColorsDidChange() override;
</span><span class="cx"> 
</span><del>-    // System fonts and colors.
-    virtual void systemFont(CSSValueID, FontDescription&amp;) const override;
</del><ins>+    // System colors.
</ins><span class="cx">     virtual Color systemColor(CSSValueID) const override;
</span><span class="cx"> 
</span><span class="cx">     virtual bool popsMenuBySpaceOrReturn() const override { return true; }
</span><span class="lines">@@ -95,25 +100,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(DATALIST_ELEMENT)
-    // Returns size of one slider tick mark for a horizontal track.
-    // For vertical tracks we rotate it and use it. i.e. Width is always length along the track.
-    virtual IntSize sliderTickSize() const override;
-    // Returns the distance of slider tick origin from the slider track center.
-    virtual int sliderTickOffsetFromTrackCenter() const override;
-#endif
-
-#ifdef GTK_API_VERSION_2
-    GtkWidget* gtkContainer() const;
-    GtkWidget* gtkEntry() const;
-    GtkWidget* gtkVScrollbar() const;
-    GtkWidget* gtkHScrollbar() const;
-    static void getIndicatorMetrics(ControlPart, int&amp; indicatorSize, int&amp; indicatorSpacing);
-#else
</del><span class="cx">     GtkStyleContext* gtkScrollbarStyle();
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    RenderThemeGtk();
+    virtual ~RenderThemeGtk();
+
</ins><span class="cx">     virtual bool paintCheckbox(const RenderObject&amp;, const PaintInfo&amp;, const IntRect&amp;) override;
</span><span class="cx">     virtual void setCheckboxSize(RenderStyle&amp;) const override;
</span><span class="cx"> 
</span><span class="lines">@@ -194,7 +186,6 @@
</span><span class="cx"> 
</span><span class="cx">     void platformInit();
</span><span class="cx">     static void setTextInputBorders(RenderStyle&amp;);
</span><del>-    static double getScreenDPI();
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     bool paintMediaButton(const RenderObject&amp;, GraphicsContext*, const IntRect&amp;, const char* symbolicIconName, const char* fallbackStockIconName);
</span><span class="lines">@@ -207,48 +198,7 @@
</span><span class="cx">     mutable Color m_sliderThumbColor;
</span><span class="cx">     const int m_mediaIconSize;
</span><span class="cx">     const int m_mediaSliderHeight;
</span><del>-
-#ifdef GTK_API_VERSION_2
-    void setupWidgetAndAddToContainer(GtkWidget*, GtkWidget*) const;
-    void refreshComboBoxChildren() const;
-    void getComboBoxPadding(RenderStyle&amp;, int&amp; left, int&amp; top, int&amp; right, int&amp; bottom) const;
-    int getComboBoxSeparatorWidth() const;
-    int comboBoxArrowSize(RenderStyle&amp;) const;
-
-    GtkWidget* gtkButton() const;
-    GtkWidget* gtkTreeView() const;
-    GtkWidget* gtkVScale() const;
-    GtkWidget* gtkHScale() const;
-    GtkWidget* gtkRadioButton() const;
-    GtkWidget* gtkCheckButton() const;
-    GtkWidget* gtkProgressBar() const;
-    GtkWidget* gtkComboBox() const;
-    GtkWidget* gtkComboBoxButton() const;
-    GtkWidget* gtkComboBoxArrow() const;
-    GtkWidget* gtkComboBoxSeparator() const;
-    GtkWidget* gtkSpinButton() const;
-
-    GdkColormap* m_colormap;
-    mutable GtkWidget* m_gtkWindow;
-    mutable GtkWidget* m_gtkContainer;
-    mutable GtkWidget* m_gtkButton;
-    mutable GtkWidget* m_gtkEntry;
-    mutable GtkWidget* m_gtkTreeView;
-    mutable GtkWidget* m_gtkVScale;
-    mutable GtkWidget* m_gtkHScale;
-    mutable GtkWidget* m_gtkRadioButton;
-    mutable GtkWidget* m_gtkCheckButton;
-    mutable GtkWidget* m_gtkProgressBar;
-    mutable GtkWidget* m_gtkComboBox;
-    mutable GtkWidget* m_gtkComboBoxButton;
-    mutable GtkWidget* m_gtkComboBoxArrow;
-    mutable GtkWidget* m_gtkComboBoxSeparator;
-    mutable GtkWidget* m_gtkVScrollbar;
-    mutable GtkWidget* m_gtkHScrollbar;
-    mutable GtkWidget* m_gtkSpinButton;
-    bool m_themePartsHaveRGBAColormap;
-    friend class WidgetRenderingContext;
-#endif
</del><ins>+#endif // GTK_API_VERSION_2
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtk2cpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -1,969 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc.
- * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2009 Kenneth Rohde Christiansen
- * Copyright (C) 2010 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include &quot;config.h&quot;
-#include &quot;RenderThemeGtk.h&quot;
-
-#ifdef GTK_API_VERSION_2
-
-// We need this to allow building while using GTK_WIDGET_SET_FLAGS. It's deprecated
-// but some theme engines require it to ensure proper rendering of focus indicators.
-#undef GTK_DISABLE_DEPRECATED
-
-#include &quot;CSSValueKeywords.h&quot;
-#include &quot;Font.h&quot;
-#include &quot;GraphicsContext.h&quot;
-#include &quot;GtkVersioning.h&quot;
-#include &quot;HTMLNames.h&quot;
-#include &quot;MediaControlElements.h&quot;
-#include &quot;PaintInfo.h&quot;
-#include &quot;RenderElement.h&quot;
-#include &quot;TextDirection.h&quot;
-#include &quot;UserAgentStyleSheets.h&quot;
-#include &quot;WidgetRenderingContext.h&quot;
-#include &lt;gdk/gdk.h&gt;
-#include &lt;gtk/gtk.h&gt;
-
-namespace WebCore {
-
-// This is the default value defined by GTK+, where it was defined as MIN_ARROW_WIDTH in gtkspinbutton.c.
-static const int minSpinButtonArrowSize = 6;
-
-// This is not a static method, because we want to avoid having GTK+ headers in RenderThemeGtk.h.
-extern GtkTextDirection gtkTextDirection(TextDirection);
-
-void RenderThemeGtk::platformInit()
-{
-    m_themePartsHaveRGBAColormap = true;
-    m_gtkWindow = 0;
-    m_gtkContainer = 0;
-    m_gtkButton = 0;
-    m_gtkEntry = 0;
-    m_gtkTreeView = 0;
-    m_gtkVScale = 0;
-    m_gtkHScale = 0;
-    m_gtkRadioButton = 0;
-    m_gtkCheckButton = 0;
-    m_gtkProgressBar = 0;
-    m_gtkComboBox = 0;
-    m_gtkComboBoxButton = 0;
-    m_gtkComboBoxArrow = 0;
-    m_gtkComboBoxSeparator = 0;
-    m_gtkVScrollbar = 0;
-    m_gtkHScrollbar = 0;
-    m_gtkSpinButton = 0;
-
-    m_colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default());
-    if (!m_colormap) {
-        m_themePartsHaveRGBAColormap = false;
-        m_colormap = gdk_screen_get_default_colormap(gdk_screen_get_default());
-    }
-}
-
-RenderThemeGtk::~RenderThemeGtk()
-{
-    if (m_gtkWindow)
-        gtk_widget_destroy(m_gtkWindow);
-}
-
-#if ENABLE(VIDEO)
-void RenderThemeGtk::initMediaColors()
-{
-    GtkStyle* style = gtk_widget_get_style(GTK_WIDGET(gtkContainer()));
-    m_panelColor = style-&gt;bg[GTK_STATE_NORMAL];
-    m_sliderColor = style-&gt;bg[GTK_STATE_ACTIVE];
-    m_sliderThumbColor = style-&gt;bg[GTK_STATE_SELECTED];
-}
-#endif
-
-static void adjustRectForFocus(GtkWidget* widget, FloatRect&amp; rect, bool ignoreInteriorFocusProperty = false)
-{
-    gint focusWidth, focusPad;
-    gboolean interiorFocus = 0;
-    gtk_widget_style_get(widget,
-                         &quot;interior-focus&quot;, &amp;interiorFocus,
-                         &quot;focus-line-width&quot;, &amp;focusWidth,
-                         &quot;focus-padding&quot;, &amp;focusPad, NULL);
-    if (!ignoreInteriorFocusProperty &amp;&amp; interiorFocus)
-        return;
-    rect.inflate(focusWidth + focusPad);
-}
-
-void RenderThemeGtk::adjustRepaintRect(const RenderObject&amp; renderObject, FloatRect&amp; rect)
-{
-    ControlPart part = renderObject.style().appearance();
-    switch (part) {
-    case CheckboxPart:
-    case RadioPart: {
-        // We ignore the interior focus property and always expand the focus rect. In GTK+, the
-        // focus indicator is usually on the text next to a checkbox or radio button, but that doesn't
-        // happen in WebCore. By expanding the focus rectangle unconditionally we increase its prominence.
-        adjustRectForFocus(part == CheckboxPart ? gtkCheckButton() : gtkRadioButton(), rect, true);
-        return;
-    }
-    case InnerSpinButtonPart:
-        // See paintInnerSpinButton for an explanation of why we expand the painting rect.
-        rect.inflateY(2);
-        rect.setWidth(rect.width() + 2);
-    default:
-        return;
-    }
-}
-
-static GtkStateType getGtkStateType(RenderThemeGtk* theme, const RenderObject&amp; object)
-{
-    if (!theme-&gt;isEnabled(object) || theme-&gt;isReadOnlyControl(object))
-        return GTK_STATE_INSENSITIVE;
-    if (theme-&gt;isPressed(object))
-        return GTK_STATE_ACTIVE;
-    if (theme-&gt;isHovered(object))
-        return GTK_STATE_PRELIGHT;
-    return GTK_STATE_NORMAL;
-}
-
-static void setToggleSize(const RenderThemeGtk*, RenderStyle&amp; style, GtkWidget* widget)
-{
-    // The width and height are both specified, so we shouldn't change them.
-    if (!style.width().isIntrinsicOrAuto() &amp;&amp; !style.height().isAuto())
-        return;
-
-    gint indicatorSize;
-    gtk_widget_style_get(widget, &quot;indicator-size&quot;, &amp;indicatorSize, NULL);
-    if (style.width().isIntrinsicOrAuto())
-        style.setWidth(Length(indicatorSize, Fixed));
-    if (style.height().isAuto())
-        style.setHeight(Length(indicatorSize, Fixed));
-}
-
-static void paintToggle(RenderThemeGtk* theme, const RenderObject&amp; renderObject, const PaintInfo&amp; info, const IntRect&amp; rect, GtkWidget* widget)
-{
-    // We do not call gtk_toggle_button_set_active here, because some themes begin a series of
-    // animation frames in a &quot;toggled&quot; signal handler. This puts some checkboxes in a half-way
-    // checked state. Every GTK+ theme I tested merely looks at the shadow type (and not the
-    // 'active' property) to determine whether or not to draw the check.
-    gtk_widget_set_sensitive(widget, theme-&gt;isEnabled(renderObject) &amp;&amp; !theme-&gt;isReadOnlyControl(renderObject));
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
-
-    bool indeterminate = theme-&gt;isIndeterminate(renderObject);
-    gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(widget), indeterminate);
-
-    GtkShadowType shadowType = GTK_SHADOW_OUT;
-    if (indeterminate) // This originates from the Mozilla code.
-        shadowType = GTK_SHADOW_ETCHED_IN;
-    else if (theme-&gt;isChecked(renderObject))
-        shadowType = GTK_SHADOW_IN;
-
-    WidgetRenderingContext widgetContext(info.context, rect);
-    IntRect buttonRect(IntPoint(), rect.size());
-    GtkStateType toggleState = getGtkStateType(theme, renderObject);
-    const char* detail = 0;
-    if (GTK_IS_RADIO_BUTTON(widget)) {
-        detail = &quot;radiobutton&quot;;
-        widgetContext.gtkPaintOption(buttonRect, widget, toggleState, shadowType, detail);
-    } else {
-        detail = &quot;checkbutton&quot;;
-        widgetContext.gtkPaintCheck(buttonRect, widget, toggleState, shadowType, detail);
-    }
-
-    if (theme-&gt;isFocused(renderObject)) {
-        FloatRect focusRect(buttonRect);
-        adjustRectForFocus(widget, focusRect, true);
-        // FIXME: adopt device pixel positioned themes.
-        widgetContext.gtkPaintFocus(IntRect(focusRect), widget, toggleState, detail);
-    }
-}
-
-void RenderThemeGtk::setCheckboxSize(RenderStyle&amp; style) const
-{
-    setToggleSize(this, style, gtkCheckButton());
-}
-
-bool RenderThemeGtk::paintCheckbox(const RenderObject&amp; renderObject, const PaintInfo&amp; info, const IntRect&amp; rect)
-{
-    paintToggle(this, renderObject, info, rect, gtkCheckButton());
-    return false;
-}
-
-void RenderThemeGtk::setRadioSize(RenderStyle&amp; style) const
-{
-    setToggleSize(this, style, gtkRadioButton());
-}
-
-bool RenderThemeGtk::paintRadio(const RenderObject&amp; renderObject, const PaintInfo&amp; info, const IntRect&amp; rect)
-{
-    paintToggle(this, renderObject, info, rect, gtkRadioButton());
-    return false;
-}
-
-static void setWidgetHasFocus(GtkWidget* widget, gboolean hasFocus)
-{
-    g_object_set(widget, &quot;has-focus&quot;, hasFocus, NULL);
-
-    // These functions are deprecated in GTK+ 2.22, yet theme engines still look
-    // at these flags when determining if a widget has focus, so we must use them.
-    if (hasFocus)
-        GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS);
-    else
-        GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS);
-}
-
-bool RenderThemeGtk::paintButton(const RenderObject&amp; object, const PaintInfo&amp; info, const IntRect&amp; rect)
-{
-    if (info.context-&gt;paintingDisabled())
-        return false;
-
-    GtkWidget* widget = gtkButton();
-    IntRect buttonRect(IntPoint(), rect.size());
-    IntRect focusRect(buttonRect);
-
-    GtkStateType state = getGtkStateType(this, object);
-    gtk_widget_set_state(widget, state);
-    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
-
-    if (isFocused(object)) {
-        setWidgetHasFocus(widget, TRUE);
-
-        gboolean interiorFocus = 0, focusWidth = 0, focusPadding = 0;
-        gtk_widget_style_get(widget,
-                             &quot;interior-focus&quot;, &amp;interiorFocus,
-                             &quot;focus-line-width&quot;, &amp;focusWidth,
-                             &quot;focus-padding&quot;, &amp;focusPadding, NULL);
-        // If we are using exterior focus, we shrink the button rect down before
-        // drawing. If we are using interior focus we shrink the focus rect. This
-        // approach originates from the Mozilla theme drawing code (gtk2drawing.c).
-        if (interiorFocus) {
-            GtkStyle* style = gtk_widget_get_style(widget);
-            focusRect.inflateX(-style-&gt;xthickness - focusPadding);
-            focusRect.inflateY(-style-&gt;ythickness - focusPadding);
-        } else {
-            buttonRect.inflateX(-focusWidth - focusPadding);
-            buttonRect.inflateY(-focusPadding - focusPadding);
-        }
-    }
-
-    WidgetRenderingContext widgetContext(info.context, rect);
-    GtkShadowType shadowType = state == GTK_STATE_ACTIVE ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-    widgetContext.gtkPaintBox(buttonRect, widget, state, shadowType, &quot;button&quot;);
-    if (isFocused(object))
-        widgetContext.gtkPaintFocus(focusRect, widget, state, &quot;button&quot;);
-
-    setWidgetHasFocus(widget, FALSE);
-    return false;
-}
-
-int RenderThemeGtk::getComboBoxSeparatorWidth() const
-{
-    GtkWidget* separator = gtkComboBoxSeparator();
-    if (!separator)
-        return 0;
-
-    gboolean hasWideSeparators = FALSE;
-    gint separatorWidth = 0;
-    gtk_widget_style_get(separator,
-                         &quot;wide-separators&quot;, &amp;hasWideSeparators,
-                         &quot;separator-width&quot;, &amp;separatorWidth,
-                         NULL);
-    if (hasWideSeparators)
-        return separatorWidth;
-    return gtk_widget_get_style(separator)-&gt;xthickness;
-}
-
-int RenderThemeGtk::comboBoxArrowSize(RenderStyle&amp; style) const
-{
-    // Taking the font size and reversing the DPI conversion seems to match
-    // GTK+ rendering as closely as possible.
-    return style.font().size() * (72.0 / RenderThemeGtk::getScreenDPI());
-}
-
-static void getButtonInnerBorder(GtkWidget* button, int&amp; left, int&amp; top, int&amp; right, int&amp; bottom)
-{
-    GtkStyle* style = gtk_widget_get_style(button);
-    int outerBorder = gtk_container_get_border_width(GTK_CONTAINER(button));
-    static GtkBorder defaultInnerBorder = {1, 1, 1, 1};
-    GtkBorder* innerBorder;
-    gtk_widget_style_get(button, &quot;inner-border&quot;, &amp;innerBorder, NULL);
-    if (!innerBorder)
-        innerBorder = &amp;defaultInnerBorder;
-
-    left = outerBorder + innerBorder-&gt;left + style-&gt;xthickness;
-    right = outerBorder + innerBorder-&gt;right + style-&gt;xthickness;
-    top = outerBorder + innerBorder-&gt;top + style-&gt;ythickness;
-    bottom = outerBorder + innerBorder-&gt;bottom + style-&gt;ythickness;
-
-    if (innerBorder != &amp;defaultInnerBorder)
-        gtk_border_free(innerBorder);
-}
-
-
-void RenderThemeGtk::getComboBoxPadding(RenderStyle&amp; style, int&amp; left, int&amp; top, int&amp; right, int&amp; bottom) const
-{
-    // If this menu list button isn't drawn using the native theme, we
-    // don't add any extra padding beyond what WebCore already uses.
-    if (style.appearance() == NoControlPart)
-        return;
-
-    // A combo box button is a button with widgets packed into it.
-    GtkStyle* buttonWidgetStyle = gtk_widget_get_style(gtkComboBoxButton());
-    getButtonInnerBorder(gtkComboBoxButton(), left, top, right, bottom);
-
-    // Add xthickness amount of padding for each side of the separator. This ensures
-    // that the text does not bump up against the separator.
-    int arrowAndSeperatorLength = comboBoxArrowSize(style) +
-        getComboBoxSeparatorWidth() + (3 * buttonWidgetStyle-&gt;xthickness);
-
-    if (style.direction() == RTL)
-        left += arrowAndSeperatorLength;
-    else
-        right += arrowAndSeperatorLength;
-}
-
-int RenderThemeGtk::popupInternalPaddingLeft(RenderStyle&amp; style) const
-{
-    int left = 0, top = 0, right = 0, bottom = 0;
-    getComboBoxPadding(style, left, top, right, bottom);
-    return left;
-}
-
-int RenderThemeGtk::popupInternalPaddingRight(RenderStyle&amp; style) const
-{
-    int left = 0, top = 0, right = 0, bottom = 0;
-    getComboBoxPadding(style, left, top, right, bottom);
-    return right;
-}
-
-int RenderThemeGtk::popupInternalPaddingTop(RenderStyle&amp; style) const
-{
-    int left = 0, top = 0, right = 0, bottom = 0;
-    getComboBoxPadding(style, left, top, right, bottom);
-    return top;
-}
-
-int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle&amp; style) const
-{
-    int left = 0, top = 0, right = 0, bottom = 0;
-    getComboBoxPadding(style, left, top, right, bottom);
-    return bottom;
-}
-
-bool RenderThemeGtk::paintMenuList(const RenderObject&amp; object, const PaintInfo&amp; info, const FloatRect&amp; r)
-{
-    // FIXME: adopt subpixel themes.
-    IntRect rect = IntRect(r);   
-    if (paintButton(object, info, rect))
-        return true;
-
-    // Menu list button painting strategy.
-    // For buttons with appears-as-list set to false (having a separator):
-    // | left border | Button text | xthickness | vseparator | xthickness | arrow | xthickness | right border |
-    // For buttons with appears-as-list set to true (not having a separator):
-    // | left border | Button text | arrow | xthickness | right border |
-
-    int leftBorder = 0, rightBorder = 0, bottomBorder = 0, topBorder = 0;
-    getButtonInnerBorder(gtkComboBoxButton(), leftBorder, topBorder, rightBorder, bottomBorder);
-    RenderStyle&amp; style = object.style();
-    int arrowSize = comboBoxArrowSize(style);
-    GtkStyle* buttonStyle = gtk_widget_get_style(gtkComboBoxButton());
-
-    IntRect arrowRect(0, (rect.height() - arrowSize) / 2, arrowSize, arrowSize);
-    if (style.direction() == RTL)
-        arrowRect.setX(leftBorder + buttonStyle-&gt;xthickness);
-    else
-        arrowRect.setX(rect.width() - rightBorder - buttonStyle-&gt;xthickness - arrowSize);
-    GtkShadowType shadowType = isPressed(object) ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-
-    WidgetRenderingContext widgetContext(info.context, rect);
-    GtkStateType stateType = getGtkStateType(this, object);
-    widgetContext.gtkPaintArrow(arrowRect, gtkComboBoxArrow(), stateType, shadowType, GTK_ARROW_DOWN, &quot;arrow&quot;);
-
-    // Some combo boxes do not have a separator.
-    GtkWidget* separator = gtkComboBoxSeparator();
-    if (!separator)
-        return false;
-
-    // We want to decrease the height of the separator based on the focus padding of the button.
-    gint focusPadding = 0, focusWidth = 0; 
-    gtk_widget_style_get(gtkComboBoxButton(),
-                         &quot;focus-line-width&quot;, &amp;focusWidth,
-                         &quot;focus-padding&quot;, &amp;focusPadding, NULL);
-    topBorder += focusPadding + focusWidth;
-    bottomBorder += focusPadding + focusWidth;
-    int separatorWidth = getComboBoxSeparatorWidth();
-    IntRect separatorRect(0, topBorder, separatorWidth, rect.height() - topBorder - bottomBorder);
-    if (style.direction() == RTL)
-        separatorRect.setX(arrowRect.x() + arrowRect.width() + buttonStyle-&gt;xthickness + separatorWidth);
-    else
-        separatorRect.setX(arrowRect.x() - buttonStyle-&gt;xthickness - separatorWidth);
-
-    gboolean hasWideSeparators = FALSE;
-    gtk_widget_style_get(separator, &quot;wide-separators&quot;, &amp;hasWideSeparators, NULL);
-    if (hasWideSeparators)
-        widgetContext.gtkPaintBox(separatorRect, separator, GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT, &quot;vseparator&quot;);
-    else
-        widgetContext.gtkPaintVLine(separatorRect, separator, GTK_STATE_NORMAL, &quot;vseparator&quot;);
-
-    return false;
-}
-
-bool RenderThemeGtk::paintTextField(const RenderObject&amp; renderObject, const PaintInfo&amp; info, const FloatRect&amp; rect)
-{
-    GtkWidget* widget = gtkEntry();
-
-    bool enabled = isEnabled(renderObject) &amp;&amp; !isReadOnlyControl(renderObject);
-    GtkStateType backgroundState = enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
-    gtk_widget_set_sensitive(widget, enabled);
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
-    setWidgetHasFocus(widget, isFocused(renderObject));
-
-    WidgetRenderingContext widgetContext(info.context, IntRect(rect));
-    IntRect textFieldRect(IntPoint(), IntSize(rect.size()));
-
-    // The entry background is only painted over the interior part of the GTK+ entry, not
-    // the entire frame. This happens in the Mozilla theme drawing code as well.
-    IntRect interiorRect(textFieldRect);
-    GtkStyle* style = gtk_widget_get_style(widget);
-    interiorRect.inflateX(-style-&gt;xthickness);
-    interiorRect.inflateY(-style-&gt;ythickness);
-    widgetContext.gtkPaintFlatBox(interiorRect, widget, backgroundState, GTK_SHADOW_NONE, &quot;entry_bg&quot;);
-
-    // This is responsible for drawing the actual frame.
-    widgetContext.gtkPaintShadow(textFieldRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, &quot;entry&quot;);
-
-    gboolean interiorFocus;
-    gint focusWidth;
-    gtk_widget_style_get(widget,
-                         &quot;interior-focus&quot;, &amp;interiorFocus,
-                         &quot;focus-line-width&quot;, &amp;focusWidth,  NULL);
-    if (isFocused(renderObject) &amp;&amp; !interiorFocus) {
-        // When GTK+ paints a text entry with focus, it shrinks the size of the frame area by the
-        // focus width and paints over the previously unfocused text entry. We need to emulate that
-        // by drawing both the unfocused frame above and the focused frame here.
-        IntRect shadowRect(textFieldRect);
-        shadowRect.inflate(-focusWidth);
-        widgetContext.gtkPaintShadow(shadowRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, &quot;entry&quot;);
-
-        widgetContext.gtkPaintFocus(textFieldRect, widget, GTK_STATE_NORMAL, &quot;entry&quot;);
-    }
-
-    return false;
-}
-
-bool RenderThemeGtk::paintSliderTrack(const RenderObject&amp; object, const PaintInfo&amp; info, const IntRect&amp; rect)
-{
-    if (info.context-&gt;paintingDisabled())
-        return false;
-
-    ControlPart part = object.style().appearance();
-    ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
-
-    // We shrink the trough rect slightly to make room for the focus indicator.
-    IntRect troughRect(IntPoint(), rect.size()); // This is relative to rect.
-    GtkWidget* widget = 0;
-    if (part == SliderHorizontalPart) {
-        widget = gtkHScale();
-        troughRect.inflateX(-gtk_widget_get_style(widget)-&gt;xthickness);
-    } else {
-        widget = gtkVScale();
-        troughRect.inflateY(-gtk_widget_get_style(widget)-&gt;ythickness);
-    }
-    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
-
-    WidgetRenderingContext widgetContext(info.context, rect);
-    widgetContext.gtkPaintBox(troughRect, widget, GTK_STATE_ACTIVE, GTK_SHADOW_OUT, &quot;trough&quot;);
-    if (isFocused(object))
-        widgetContext.gtkPaintFocus(IntRect(IntPoint(), rect.size()), widget, getGtkStateType(this, object), &quot;trough&quot;);
-
-    return false;
-}
-
-bool RenderThemeGtk::paintSliderThumb(const RenderObject&amp; object, const PaintInfo&amp; info, const IntRect&amp; rect)
-{
-    if (info.context-&gt;paintingDisabled())
-        return false;
-
-    ControlPart part = object.style().appearance();
-    ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
-
-    GtkWidget* widget = 0;
-    const char* detail = 0;
-    GtkOrientation orientation;
-    if (part == SliderThumbHorizontalPart) {
-        widget = gtkHScale();
-        detail = &quot;hscale&quot;;
-        orientation = GTK_ORIENTATION_HORIZONTAL;
-    } else {
-        widget = gtkVScale();
-        detail = &quot;vscale&quot;;
-        orientation = GTK_ORIENTATION_VERTICAL;
-    }
-    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
-
-    // Only some themes have slider thumbs respond to clicks and some don't. This information is
-    // gathered via the 'activate-slider' property, but it's deprecated in GTK+ 2.22 and removed in
-    // GTK+ 3.x. The drawback of not honoring it is that slider thumbs change color when you click
-    // on them. 
-    IntRect thumbRect(IntPoint(), rect.size());
-    WidgetRenderingContext widgetContext(info.context, rect);
-    widgetContext.gtkPaintSlider(thumbRect, widget, getGtkStateType(this, object), GTK_SHADOW_OUT, detail, orientation);
-    return false;
-}
-
-void RenderThemeGtk::adjustSliderThumbSize(RenderStyle&amp; style, Element&amp;) const
-{
-    ControlPart part = style.appearance();
-    if (part != SliderThumbHorizontalPart &amp;&amp; part != SliderThumbVerticalPart)
-        return;
-
-    GtkWidget* widget = part == SliderThumbHorizontalPart ? gtkHScale() : gtkVScale();
-    int length = 0, width = 0;
-    gtk_widget_style_get(widget,
-                         &quot;slider_length&quot;, &amp;length,
-                         &quot;slider_width&quot;, &amp;width,
-                         NULL);
-
-    if (part == SliderThumbHorizontalPart) {
-        style.setWidth(Length(length, Fixed));
-        style.setHeight(Length(width, Fixed));
-        return;
-    }
-    ASSERT(part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
-    style.setWidth(Length(width, Fixed));
-    style.setHeight(Length(length, Fixed));
-}
-
-bool RenderThemeGtk::paintProgressBar(const RenderObject&amp; renderObject, const PaintInfo&amp; paintInfo, const IntRect&amp; rect)
-{
-    GtkWidget* widget = gtkProgressBar();
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
-
-    WidgetRenderingContext widgetContext(paintInfo.context, rect);
-    IntRect fullProgressBarRect(IntPoint(), rect.size());
-    widgetContext.gtkPaintBox(fullProgressBarRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, &quot;trough&quot;);
-
-    GtkStyle* style = gtk_widget_get_style(widget);
-    IntRect progressRect(fullProgressBarRect);
-    progressRect.inflateX(-style-&gt;xthickness);
-    progressRect.inflateY(-style-&gt;ythickness);
-    progressRect = RenderThemeGtk::calculateProgressRect(renderObject, progressRect);
-
-    if (!progressRect.isEmpty())
-        widgetContext.gtkPaintBox(progressRect, widget, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, &quot;bar&quot;);
-
-    return false;
-}
-
-void RenderThemeGtk::adjustInnerSpinButtonStyle(StyleResolver&amp;, RenderStyle&amp; style, Element&amp;) const
-{
-    GtkStyle* gtkStyle = gtk_widget_get_style(gtkSpinButton());
-    const PangoFontDescription* fontDescription = gtkStyle-&gt;font_desc;
-    gint fontSize = pango_font_description_get_size(fontDescription);
-
-    // Force an odd arrow size here. GTK+ 3.x forces even in this case, but
-    // Nodoka-based themes look incorrect with an even arrow size.
-    int width = std::max(PANGO_PIXELS(fontSize), minSpinButtonArrowSize);
-    width += -((width % 2) - 1) + gtkStyle-&gt;xthickness;
-
-    style.setWidth(Length(width, Fixed));
-    style.setMinWidth(Length(width, Fixed));
-}
-
-bool RenderThemeGtk::paintInnerSpinButton(const RenderObject&amp; renderObject, const PaintInfo&amp; paintInfo, const IntRect&amp; rect)
-{
-    // We expand the painted area by 2 pixels on the top and bottom and 2 pixels on the right. This
-    // is because GTK+ themes want to draw over the text box borders, but WebCore renders the inner
-    // spin button inside the text box.
-    IntRect expandedRect(rect);
-    expandedRect.inflateY(2);
-    expandedRect.setWidth(rect.width() + 2);
-
-    WidgetRenderingContext widgetContext(paintInfo.context, expandedRect);
-    GtkWidget* widget = gtkSpinButton();
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
-
-    IntRect fullSpinButtonRect(IntPoint(), expandedRect.size());
-    widgetContext.gtkPaintBox(fullSpinButtonRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, &quot;spinbutton&quot;);
-
-    bool upPressed = isSpinUpButtonPartPressed(renderObject);
-    bool upHovered = isSpinUpButtonPartHovered(renderObject);
-    bool controlActive = isEnabled(renderObject) &amp;&amp; !isReadOnlyControl(renderObject);
-    GtkShadowType shadowType = upPressed ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-
-    GtkStateType stateType = GTK_STATE_INSENSITIVE;
-    if (controlActive) {
-        if (isPressed(renderObject) &amp;&amp; upPressed)
-            stateType = GTK_STATE_ACTIVE;
-        else if (isHovered(renderObject) &amp;&amp; upHovered)
-            stateType = GTK_STATE_PRELIGHT;
-        else
-            stateType = GTK_STATE_NORMAL;
-    }
-    IntRect topRect(IntPoint(), expandedRect.size());
-    topRect.setHeight(expandedRect.height() / 2);
-    widgetContext.gtkPaintBox(topRect, widget, stateType, shadowType, &quot;spinbutton_up&quot;);
-
-    // The arrow size/position calculation here is based on the arbitrary gymnastics that happen
-    // in gtkspinbutton.c. It isn't pretty there and it isn't pretty here. This manages to make
-    // the button look native for many themes though.
-    IntRect arrowRect;
-    int arrowSize = (expandedRect.width() - 3) / 2;
-    arrowSize -= (arrowSize % 2) - 1; // Force odd.
-    arrowRect.setWidth(arrowSize);
-    arrowRect.setHeight(arrowSize);
-    arrowRect.move((expandedRect.width() - arrowRect.width()) / 2,
-                   (topRect.height() - arrowRect.height()) / 2 + 1);
-    widgetContext.gtkPaintArrow(arrowRect, widget, stateType, shadowType, GTK_ARROW_UP, &quot;spinbutton&quot;);
-
-    shadowType = isPressed(renderObject) &amp;&amp; !upPressed ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-    if (controlActive) {
-        if (isPressed(renderObject) &amp;&amp; !upPressed)
-            stateType = GTK_STATE_ACTIVE;
-        else if (isHovered(renderObject) &amp;&amp; !upHovered)
-            stateType = GTK_STATE_PRELIGHT;
-        else
-            stateType = GTK_STATE_NORMAL;
-    }
-    IntRect bottomRect(IntPoint(0, expandedRect.height() / 2), expandedRect.size());
-    bottomRect.setHeight(expandedRect.height() - bottomRect.y());
-    widgetContext.gtkPaintBox(bottomRect, widget, stateType, shadowType, &quot;spinbutton_down&quot;);
-
-    arrowRect.setY(arrowRect.y() + bottomRect.y() - 1);
-    widgetContext.gtkPaintArrow(arrowRect, widget, stateType, shadowType, GTK_ARROW_DOWN, &quot;spinbutton&quot;);
-
-    return false;
-}
-
-GRefPtr&lt;GdkPixbuf&gt; getStockIconForWidgetType(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
-{
-    ASSERT(widgetType == GTK_TYPE_CONTAINER || widgetType == GTK_TYPE_ENTRY);
-    ASSERT(iconName);
-
-    RenderThemeGtk* theme = static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get());
-    GtkWidget* widget = widgetType == GTK_TYPE_CONTAINER ? GTK_WIDGET(theme-&gt;gtkContainer()) : theme-&gt;gtkEntry();
-
-    GtkStyle* style = gtk_widget_get_style(widget);
-    GtkIconSet* iconSet = gtk_style_lookup_icon_set(style, iconName);
-    return adoptGRef(gtk_icon_set_render_icon(iconSet, style,
-                                              static_cast&lt;GtkTextDirection&gt;(direction),
-                                              static_cast&lt;GtkStateType&gt;(state),
-                                              static_cast&lt;GtkIconSize&gt;(iconSize), 0, 0));
-}
-
-GRefPtr&lt;GdkPixbuf&gt; getStockSymbolicIconForWidgetType(GType widgetType, const char* /* symbolicIconName */, const char* fallbackStockIconName, gint direction, gint state, gint iconSize)
-{
-    if (!fallbackStockIconName)
-        return nullptr;
-
-    return getStockIconForWidgetType(widgetType, fallbackStockIconName, direction, state, iconSize);
-}
-
-Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const
-{
-    GtkWidget* widget = gtkEntry();
-    return gtk_widget_get_style(widget)-&gt;base[GTK_STATE_SELECTED];
-}
-
-Color RenderThemeGtk::platformInactiveSelectionBackgroundColor() const
-{
-    GtkWidget* widget = gtkEntry();
-    return gtk_widget_get_style(widget)-&gt;base[GTK_STATE_ACTIVE];
-}
-
-Color RenderThemeGtk::platformActiveSelectionForegroundColor() const
-{
-    GtkWidget* widget = gtkEntry();
-    return gtk_widget_get_style(widget)-&gt;text[GTK_STATE_SELECTED];
-}
-
-Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const
-{
-    GtkWidget* widget = gtkEntry();
-    return gtk_widget_get_style(widget)-&gt;text[GTK_STATE_ACTIVE];
-}
-
-Color RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor() const
-{
-    GtkWidget* widget = gtkTreeView();
-    return gtk_widget_get_style(widget)-&gt;base[GTK_STATE_SELECTED];
-}
-
-Color RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor() const
-{
-    GtkWidget* widget = gtkTreeView();
-    return gtk_widget_get_style(widget)-&gt;base[GTK_STATE_ACTIVE];
-}
-
-Color RenderThemeGtk::platformActiveListBoxSelectionForegroundColor() const
-{
-    GtkWidget* widget = gtkTreeView();
-    return gtk_widget_get_style(widget)-&gt;text[GTK_STATE_SELECTED];
-}
-
-Color RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor() const
-{
-    GtkWidget* widget = gtkTreeView();
-    return gtk_widget_get_style(widget)-&gt;text[GTK_STATE_ACTIVE];
-}
-
-Color RenderThemeGtk::systemColor(CSSValueID cssValueId) const
-{
-    switch (cssValueId) {
-    case CSSValueButtontext:
-        return Color(gtk_widget_get_style(gtkButton())-&gt;fg[GTK_STATE_NORMAL]);
-    case CSSValueCaptiontext:
-        return Color(gtk_widget_get_style(gtkEntry())-&gt;fg[GTK_STATE_NORMAL]);
-    default:
-        return RenderTheme::systemColor(cssValueId);
-    }
-}
-
-static void gtkStyleSetCallback(GtkWidget*, GtkStyle*, RenderTheme* renderTheme)
-{
-    // FIXME: Make sure this function doesn't get called many times for a single GTK+ style change signal.
-    renderTheme-&gt;platformColorsDidChange();
-}
-
-static void setupWidget(GtkWidget* widget)
-{
-    gtk_widget_realize(widget);
-    g_object_set_data(G_OBJECT(widget), &quot;transparent-bg-hint&quot;, GINT_TO_POINTER(TRUE));
-}
-
-void RenderThemeGtk::setupWidgetAndAddToContainer(GtkWidget* widget, GtkWidget* window) const
-{
-    gtk_container_add(GTK_CONTAINER(window), widget);
-    setupWidget(widget);
-
-    // FIXME: Perhaps this should only be called for the containing window or parent container.
-    g_signal_connect(widget, &quot;style-set&quot;, G_CALLBACK(gtkStyleSetCallback), const_cast&lt;RenderThemeGtk*&gt;(this));
-}
-
-GtkWidget* RenderThemeGtk::gtkContainer() const
-{
-    if (m_gtkContainer)
-        return m_gtkContainer;
-
-    m_gtkWindow = gtk_window_new(GTK_WINDOW_POPUP);
-    gtk_widget_set_colormap(m_gtkWindow, m_colormap);
-    setupWidget(m_gtkWindow);
-    gtk_widget_set_name(m_gtkWindow, &quot;MozillaGtkWidget&quot;);
-
-    m_gtkContainer = gtk_fixed_new();
-    setupWidgetAndAddToContainer(m_gtkContainer, m_gtkWindow);
-    return m_gtkContainer;
-}
-
-GtkWidget* RenderThemeGtk::gtkButton() const
-{
-    if (m_gtkButton)
-        return m_gtkButton;
-    m_gtkButton = gtk_button_new();
-    setupWidgetAndAddToContainer(m_gtkButton, gtkContainer());
-    return m_gtkButton;
-}
-
-GtkWidget* RenderThemeGtk::gtkEntry() const
-{
-    if (m_gtkEntry)
-        return m_gtkEntry;
-    m_gtkEntry = gtk_entry_new();
-    setupWidgetAndAddToContainer(m_gtkEntry, gtkContainer());
-    return m_gtkEntry;
-}
-
-GtkWidget* RenderThemeGtk::gtkTreeView() const
-{
-    if (m_gtkTreeView)
-        return m_gtkTreeView;
-    m_gtkTreeView = gtk_tree_view_new();
-    setupWidgetAndAddToContainer(m_gtkTreeView, gtkContainer());
-    return m_gtkTreeView;
-}
-
-GtkWidget* RenderThemeGtk::gtkVScale() const
-{
-    if (m_gtkVScale)
-        return m_gtkVScale;
-    m_gtkVScale = gtk_vscale_new(0);
-    setupWidgetAndAddToContainer(m_gtkVScale, gtkContainer());
-    return m_gtkVScale;
-}
-
-GtkWidget* RenderThemeGtk::gtkHScale() const
-{
-    if (m_gtkHScale)
-        return m_gtkHScale;
-    m_gtkHScale = gtk_hscale_new(0);
-    setupWidgetAndAddToContainer(m_gtkHScale, gtkContainer());
-    return m_gtkHScale;
-}
-
-GtkWidget* RenderThemeGtk::gtkRadioButton() const
-{
-    if (m_gtkRadioButton)
-        return m_gtkRadioButton;
-    m_gtkRadioButton = gtk_radio_button_new(0);
-    setupWidgetAndAddToContainer(m_gtkRadioButton, gtkContainer());
-    return m_gtkRadioButton;
-}
-
-GtkWidget* RenderThemeGtk::gtkCheckButton() const
-{
-    if (m_gtkCheckButton)
-        return m_gtkCheckButton;
-    m_gtkCheckButton = gtk_check_button_new();
-    setupWidgetAndAddToContainer(m_gtkCheckButton, gtkContainer());
-    return m_gtkCheckButton;
-}
-
-GtkWidget* RenderThemeGtk::gtkProgressBar() const
-{
-    if (m_gtkProgressBar)
-        return m_gtkProgressBar;
-    m_gtkProgressBar = gtk_progress_bar_new();
-    setupWidgetAndAddToContainer(m_gtkProgressBar, gtkContainer());
-    return m_gtkProgressBar;
-}
-
-static void getGtkComboBoxButton(GtkWidget* widget, gpointer target)
-{
-    if (!GTK_IS_TOGGLE_BUTTON(widget))
-        return;
-    GtkWidget** widgetTarget = static_cast&lt;GtkWidget**&gt;(target);
-    *widgetTarget = widget;
-}
-
-typedef struct {
-    GtkWidget* arrow;
-    GtkWidget* separator;
-} ComboBoxWidgetPieces;
-
-static void getGtkComboBoxPieces(GtkWidget* widget, gpointer data)
-{
-    if (GTK_IS_ARROW(widget)) {
-        static_cast&lt;ComboBoxWidgetPieces*&gt;(data)-&gt;arrow = widget;
-        return;
-    }
-    if (GTK_IS_SEPARATOR(widget)) 
-        static_cast&lt;ComboBoxWidgetPieces*&gt;(data)-&gt;separator = widget;
-}
-
-GtkWidget* RenderThemeGtk::gtkComboBox() const
-{
-    if (m_gtkComboBox)
-        return m_gtkComboBox;
-    m_gtkComboBox = gtk_combo_box_new();
-    setupWidgetAndAddToContainer(m_gtkComboBox, gtkContainer());
-    return m_gtkComboBox;
-}
-
-void RenderThemeGtk::refreshComboBoxChildren() const
-{
-    gtkComboBox(); // Ensure that we've initialized the combo box.
-
-    // Some themes look at widget ancestry to determine how to render widgets, so
-    // get the GtkButton that is the actual child of the combo box.
-    gtk_container_forall(GTK_CONTAINER(m_gtkComboBox), getGtkComboBoxButton, &amp;m_gtkComboBoxButton);
-    ASSERT(m_gtkComboBoxButton);
-    setupWidget(m_gtkComboBoxButton);
-    g_object_add_weak_pointer(G_OBJECT(m_gtkComboBoxButton), reinterpret_cast&lt;gpointer*&gt;(&amp;m_gtkComboBoxButton));
-
-    ComboBoxWidgetPieces pieces = { 0, 0 };
-    GtkWidget* buttonChild = gtk_bin_get_child(GTK_BIN(gtkComboBoxButton()));
-    if (GTK_IS_HBOX(buttonChild))
-        gtk_container_forall(GTK_CONTAINER(buttonChild), getGtkComboBoxPieces, &amp;pieces);
-    else if (GTK_IS_ARROW(buttonChild))
-        pieces.arrow = buttonChild;
-
-    ASSERT(pieces.arrow);
-    m_gtkComboBoxArrow = pieces.arrow;
-    setupWidget(m_gtkComboBoxArrow);
-    // When the style changes, the combo box may destroy its children.
-    g_object_add_weak_pointer(G_OBJECT(m_gtkComboBoxArrow), reinterpret_cast&lt;gpointer*&gt;(&amp;m_gtkComboBoxArrow));
-
-    m_gtkComboBoxSeparator = pieces.separator;
-    if (m_gtkComboBoxSeparator) {
-        setupWidget(m_gtkComboBoxSeparator);
-        // When the style changes, the combo box may destroy its children.
-        g_object_add_weak_pointer(G_OBJECT(m_gtkComboBoxSeparator), reinterpret_cast&lt;gpointer*&gt;(&amp;m_gtkComboBoxSeparator));
-    }
-}
-
-GtkWidget* RenderThemeGtk::gtkComboBoxButton() const
-{
-    if (m_gtkComboBoxButton)
-        return m_gtkComboBoxButton;
-    refreshComboBoxChildren();
-    ASSERT(m_gtkComboBoxButton);
-    return m_gtkComboBoxButton;
-}
-
-GtkWidget* RenderThemeGtk::gtkComboBoxArrow() const
-{
-    if (m_gtkComboBoxArrow)
-        return m_gtkComboBoxArrow;
-    refreshComboBoxChildren();
-    ASSERT(m_gtkComboBoxArrow);
-    return m_gtkComboBoxArrow;
-}
-
-GtkWidget* RenderThemeGtk::gtkComboBoxSeparator() const
-{
-    // m_gtkComboBoxSeparator may be null either because we haven't initialized the combo box
-    // or because the combo boxes in this theme don't have separators. If m_gtkComboBoxArrow
-    // arrow isn't null, we definitely have initialized the combo box.
-    if (m_gtkComboBoxArrow || m_gtkComboBoxButton)
-        return m_gtkComboBoxSeparator;
-    refreshComboBoxChildren();
-    return m_gtkComboBoxSeparator;
-}
-
-GtkWidget* RenderThemeGtk::gtkHScrollbar() const
-{
-    if (m_gtkHScrollbar)
-        return m_gtkHScrollbar;
-    m_gtkHScrollbar = gtk_hscrollbar_new(0);
-    setupWidgetAndAddToContainer(m_gtkHScrollbar, gtkContainer());
-    return m_gtkHScrollbar;
-}
-
-GtkWidget* RenderThemeGtk::gtkVScrollbar() const
-{
-    if (m_gtkVScrollbar)
-        return m_gtkVScrollbar;
-    m_gtkVScrollbar = gtk_vscrollbar_new(0);
-    setupWidgetAndAddToContainer(m_gtkVScrollbar, gtkContainer());
-    return m_gtkVScrollbar;
-}
-
-GtkWidget* RenderThemeGtk::gtkSpinButton() const
-{
-    if (m_gtkSpinButton)
-        return m_gtkSpinButton;
-    m_gtkSpinButton = gtk_spin_button_new_with_range(0, 10, 1);
-    setupWidgetAndAddToContainer(m_gtkSpinButton, gtkContainer());
-    return m_gtkSpinButton;
-}
-
-} // namespace WebCore
-
-#endif // GTK_API_VERSION_2
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtk3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &lt;cmath&gt;
</span><span class="cx"> #include &lt;gdk/gdk.h&gt;
</span><span class="cx"> #include &lt;gtk/gtk.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></pre></div>
<a id="trunkSourceWebCoreplatformgtkScrollbarThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -33,8 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static HashSet&lt;ScrollbarThemeClient*&gt;* gScrollbars;
-
</del><span class="cx"> ScrollbarTheme* ScrollbarTheme::nativeTheme()
</span><span class="cx"> {
</span><span class="cx">     static ScrollbarThemeGtk theme;
</span><span class="lines">@@ -45,56 +43,20 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollbarThemeGtk::registerScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    if (!gScrollbars)
-        gScrollbars = new HashSet&lt;ScrollbarThemeClient*&gt;;
-    gScrollbars-&gt;add(scrollbar);
-}
-
-void ScrollbarThemeGtk::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    gScrollbars-&gt;remove(scrollbar);
-    if (gScrollbars-&gt;isEmpty()) {
-        delete gScrollbars;
-        gScrollbars = 0;
-    }
-}
-
-void ScrollbarThemeGtk::updateScrollbarsFrameThickness()
-{
-    if (!gScrollbars)
-        return;
-
-    // Update the thickness of every interior frame scrollbar widget. The
-    // platform-independent scrollbar them code isn't yet smart enough to get
-    // this information when it paints.
-    HashSet&lt;ScrollbarThemeClient*&gt;::iterator end = gScrollbars-&gt;end();
-    for (HashSet&lt;ScrollbarThemeClient*&gt;::iterator it = gScrollbars-&gt;begin(); it != end; ++it) {
-        ScrollbarThemeClient* scrollbar = (*it);
-
-        // Top-level scrollbar i.e. scrollbars who have a parent ScrollView
-        // with no parent are native, and thus do not need to be resized.
-        if (!scrollbar-&gt;parent() || !scrollbar-&gt;parent()-&gt;parent())
-            return;
-
-        int thickness = scrollbarThickness(scrollbar-&gt;controlSize());
-        if (scrollbar-&gt;orientation() == HorizontalScrollbar)
-            scrollbar-&gt;setFrameRect(IntRect(0, scrollbar-&gt;parent()-&gt;height() - thickness, scrollbar-&gt;width(), thickness));
-        else
-            scrollbar-&gt;setFrameRect(IntRect(scrollbar-&gt;parent()-&gt;width() - thickness, 0, thickness, scrollbar-&gt;height()));
-    }
-}
-
</del><span class="cx"> bool ScrollbarThemeGtk::hasThumb(ScrollbarThemeClient* scrollbar)
</span><span class="cx"> {
</span><ins>+#ifndef GTK_API_VERSION_2
</ins><span class="cx">     // This method is just called as a paint-time optimization to see if
</span><span class="cx">     // painting the thumb can be skipped.  We don't have to be exact here.
</span><span class="cx">     return thumbLength(scrollbar) &gt; 0;
</span><ins>+#else
+    return false;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect ScrollbarThemeGtk::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
</span><span class="cx"> {
</span><ins>+#ifndef GTK_API_VERSION_2
</ins><span class="cx">     if (part == BackButtonEndPart &amp;&amp; !m_hasBackButtonEndPart)
</span><span class="cx">         return IntRect();
</span><span class="cx">     if (part == BackButtonStartPart &amp;&amp; !m_hasBackButtonStartPart)
</span><span class="lines">@@ -112,10 +74,14 @@
</span><span class="cx"> 
</span><span class="cx">     // VerticalScrollbar alternate button
</span><span class="cx">     return IntRect(x, scrollbar-&gt;y() + scrollbar-&gt;height() - m_troughBorderWidth - (2 * size.height()), size.width(), size.height());
</span><ins>+#else
+    return IntRect();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect ScrollbarThemeGtk::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
</span><span class="cx"> {
</span><ins>+#ifndef GTK_API_VERSION_2
</ins><span class="cx">     if (part == ForwardButtonStartPart &amp;&amp; !m_hasForwardButtonStartPart)
</span><span class="cx">         return IntRect();
</span><span class="cx">     if (part == ForwardButtonEndPart &amp;&amp; !m_hasForwardButtonEndPart)
</span><span class="lines">@@ -138,10 +104,14 @@
</span><span class="cx"> 
</span><span class="cx">     // ForwardButtonStartPart (alternate button)
</span><span class="cx">     return IntRect(x, scrollbar-&gt;y() + m_troughBorderWidth + size.height(), size.width(), size.height());
</span><ins>+#else
+    return IntRect();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect ScrollbarThemeGtk::trackRect(ScrollbarThemeClient* scrollbar, bool)
</span><span class="cx"> {
</span><ins>+#ifndef GTK_API_VERSION_2
</ins><span class="cx">     // The padding along the thumb movement axis includes the trough border
</span><span class="cx">     // plus the size of stepper spacing (the space between the stepper and
</span><span class="cx">     // the place where the thumb stops). There is often no stepper spacing.
</span><span class="lines">@@ -178,8 +148,55 @@
</span><span class="cx">         return IntRect();
</span><span class="cx">     return IntRect(scrollbar-&gt;x(), scrollbar-&gt;y() + movementAxisPadding + startButtonsOffset,
</span><span class="cx">                    thickness, scrollbar-&gt;height() - (2 * movementAxisPadding) - buttonsWidth);
</span><ins>+#else
+    return IntRect();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef GTK_API_VERSION_2
+static HashSet&lt;ScrollbarThemeClient*&gt;* gScrollbars;
+
+void ScrollbarThemeGtk::registerScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    if (!gScrollbars)
+        gScrollbars = new HashSet&lt;ScrollbarThemeClient*&gt;;
+    gScrollbars-&gt;add(scrollbar);
+}
+
+void ScrollbarThemeGtk::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    gScrollbars-&gt;remove(scrollbar);
+    if (gScrollbars-&gt;isEmpty()) {
+        delete gScrollbars;
+        gScrollbars = 0;
+    }
+}
+
+void ScrollbarThemeGtk::updateScrollbarsFrameThickness()
+{
+    if (!gScrollbars)
+        return;
+
+    // Update the thickness of every interior frame scrollbar widget. The
+    // platform-independent scrollbar them code isn't yet smart enough to get
+    // this information when it paints.
+    HashSet&lt;ScrollbarThemeClient*&gt;::iterator end = gScrollbars-&gt;end();
+    for (HashSet&lt;ScrollbarThemeClient*&gt;::iterator it = gScrollbars-&gt;begin(); it != end; ++it) {
+        ScrollbarThemeClient* scrollbar = (*it);
+
+        // Top-level scrollbar i.e. scrollbars who have a parent ScrollView
+        // with no parent are native, and thus do not need to be resized.
+        if (!scrollbar-&gt;parent() || !scrollbar-&gt;parent()-&gt;parent())
+            return;
+
+        int thickness = scrollbarThickness(scrollbar-&gt;controlSize());
+        if (scrollbar-&gt;orientation() == HorizontalScrollbar)
+            scrollbar-&gt;setFrameRect(IntRect(0, scrollbar-&gt;parent()-&gt;height() - thickness, scrollbar-&gt;width(), thickness));
+        else
+            scrollbar-&gt;setFrameRect(IntRect(scrollbar-&gt;parent()-&gt;width() - thickness, 0, thickness, scrollbar-&gt;height()));
+    }
+}
+
</ins><span class="cx"> IntRect ScrollbarThemeGtk::thumbRect(ScrollbarThemeClient* scrollbar, const IntRect&amp; unconstrainedTrackRect)
</span><span class="cx"> {
</span><span class="cx">     IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect);
</span><span class="lines">@@ -283,6 +300,6 @@
</span><span class="cx"> {
</span><span class="cx">     return m_minThumbLength;
</span><span class="cx"> }
</span><ins>+#endif // GTK_API_VERSION_2
</ins><span class="cx"> 
</span><span class="cx"> }
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkScrollbarThemeGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> class ScrollbarThemeGtk : public ScrollbarThemeComposite {
</span><span class="cx"> public:
</span><del>-    ScrollbarThemeGtk();
</del><span class="cx">     virtual ~ScrollbarThemeGtk();
</span><span class="cx"> 
</span><span class="cx">     virtual bool hasButtons(ScrollbarThemeClient*) { return true; }
</span><span class="lines">@@ -42,6 +41,10 @@
</span><span class="cx">     virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool);
</span><span class="cx">     virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool);
</span><span class="cx">     virtual IntRect trackRect(ScrollbarThemeClient*, bool);
</span><ins>+
+#ifndef GTK_API_VERSION_2
+    ScrollbarThemeGtk();
+
</ins><span class="cx">     IntRect thumbRect(ScrollbarThemeClient*, const IntRect&amp; unconstrainedTrackRect);
</span><span class="cx">     bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect&amp; damageRect);
</span><span class="cx">     void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*);
</span><span class="lines">@@ -62,9 +65,8 @@
</span><span class="cx">     void unregisterScrollbar(ScrollbarThemeClient*);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-#ifndef GTK_API_VERSION_2
</del><span class="cx">     GtkStyleContext* m_context;
</span><del>-#endif
</del><ins>+
</ins><span class="cx">     int m_thumbFatness;
</span><span class="cx">     int m_troughBorderWidth;
</span><span class="cx">     int m_stepperSize;
</span><span class="lines">@@ -75,7 +77,9 @@
</span><span class="cx">     gboolean m_hasForwardButtonEndPart;
</span><span class="cx">     gboolean m_hasBackButtonStartPart;
</span><span class="cx">     gboolean m_hasBackButtonEndPart;
</span><ins>+#endif // GTK_API_VERSION_2
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkScrollbarThemeGtk2cpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -1,218 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-#include &quot;ScrollbarThemeGtk.h&quot;
-
-#ifdef GTK_API_VERSION_2
-
-#include &quot;GtkVersioning.h&quot;
-#include &quot;PlatformMouseEvent.h&quot;
-#include &quot;RenderThemeGtk.h&quot;
-#include &quot;ScrollView.h&quot;
-#include &quot;Scrollbar.h&quot;
-#include &quot;WidgetRenderingContext.h&quot;
-#include &lt;gtk/gtk.h&gt;
-
-namespace WebCore {
-
-static void gtkStyleSetCallback(GtkWidget*, GtkStyle*, ScrollbarThemeGtk* scrollbarTheme)
-{
-    scrollbarTheme-&gt;updateThemeProperties();
-}
-
-ScrollbarThemeGtk::ScrollbarThemeGtk()
-{
-    updateThemeProperties();
-    g_signal_connect(static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get())-&gt;gtkHScrollbar(),
-         &quot;style-set&quot;, G_CALLBACK(gtkStyleSetCallback), this);
-}
-
-void ScrollbarThemeGtk::updateThemeProperties()
-{
-    GtkWidget* scrollbar = static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get())-&gt;gtkHScrollbar();
-    gtk_widget_style_get(scrollbar,
-                         &quot;slider_width&quot;, &amp;m_thumbFatness,
-                         &quot;trough_border&quot;, &amp;m_troughBorderWidth,
-                         &quot;stepper-size&quot;, &amp;m_stepperSize,
-                         &quot;trough-under-steppers&quot;, &amp;m_troughUnderSteppers,
-                         &quot;has-backward-stepper&quot;, &amp;m_hasBackButtonStartPart,
-                         &quot;has-forward-stepper&quot;, &amp;m_hasForwardButtonEndPart,
-                         &quot;has-secondary-forward-stepper&quot;, &amp;m_hasForwardButtonStartPart,
-                         &quot;has-secondary-backward-stepper&quot;, &amp;m_hasBackButtonEndPart, NULL);
-    m_minThumbLength = gtk_range_get_min_slider_size(GTK_RANGE(scrollbar));
-    updateScrollbarsFrameThickness();
-}
-
-static GtkWidget* getWidgetForScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    RenderThemeGtk* theme = static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get());
-    return scrollbar-&gt;orientation() == VerticalScrollbar ? theme-&gt;gtkVScrollbar() : theme-&gt;gtkHScrollbar();
-}
-
-void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect&amp; rect)
-{
-    // Paint the track background. If the trough-under-steppers property is true, this
-    // should be the full size of the scrollbar, but if is false, it should only be the
-    // track rect.
-    IntRect fullScrollbarRect(rect);
-    if (m_troughUnderSteppers)
-        fullScrollbarRect = IntRect(scrollbar-&gt;x(), scrollbar-&gt;y(), scrollbar-&gt;width(), scrollbar-&gt;height());
-
-    WidgetRenderingContext widgetContext(context, fullScrollbarRect);
-    IntRect paintRect(IntPoint(), fullScrollbarRect.size());
-    widgetContext.gtkPaintBox(paintRect, getWidgetForScrollbar(scrollbar),
-                              GTK_STATE_ACTIVE, GTK_SHADOW_IN, &quot;trough&quot;);
-}
-
-void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
-{
-    IntRect fullScrollbarRect = IntRect(scrollbar-&gt;x(), scrollbar-&gt;y(), scrollbar-&gt;width(), scrollbar-&gt;height());
-
-    WidgetRenderingContext widgetContext(context, fullScrollbarRect);
-    widgetContext.gtkPaintBox(fullScrollbarRect, getWidgetForScrollbar(scrollbar),
-                              GTK_STATE_NORMAL, GTK_SHADOW_IN, &quot;scrolled_window&quot;);
-}
-
-void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect&amp; rect)
-{
-    GtkWidget* widget = getWidgetForScrollbar(scrollbar);
-    gboolean activateSlider;
-    gtk_widget_style_get(widget, &quot;activate-slider&quot;, &amp;activateSlider, NULL);
-
-    GtkStateType stateType = GTK_STATE_NORMAL;
-    GtkShadowType shadowType = GTK_SHADOW_OUT;
-    if (activateSlider &amp;&amp; scrollbar-&gt;pressedPart() == ThumbPart) {
-        stateType = GTK_STATE_ACTIVE;
-        shadowType = GTK_SHADOW_IN;
-    } else if (scrollbar-&gt;pressedPart() == ThumbPart || scrollbar-&gt;hoveredPart() == ThumbPart)
-        stateType = GTK_STATE_PRELIGHT;
-
-    // The adjustment controls the rendering of the scrollbar thumb. If it's not set
-    // properly the theme may not draw the thumb borders properly.
-    GtkAdjustment* adjustment = gtk_range_get_adjustment(GTK_RANGE(widget));
-    gtk_adjustment_set_value(adjustment, scrollbar-&gt;currentPos());
-    gtk_adjustment_set_lower(adjustment, 0);
-    gtk_adjustment_set_upper(adjustment, scrollbar-&gt;maximum());
-
-    GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL;
-    if (scrollbar-&gt;orientation() == VerticalScrollbar) {
-        gtk_adjustment_set_page_size(adjustment, rect.height());
-        orientation = GTK_ORIENTATION_VERTICAL;
-    } else
-        gtk_adjustment_set_page_size(adjustment, rect.width());
-
-    WidgetRenderingContext widgetContext(context, rect);
-    IntRect sliderRect(IntPoint(), rect.size());
-    widgetContext.gtkPaintSlider(sliderRect, widget, stateType, shadowType, &quot;slider&quot;, orientation);
-}
-
-void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect&amp; rect, ScrollbarPart part)
-{
-    // The buttons will be disabled if the thumb is as the appropriate extreme.
-    GtkShadowType shadowType = GTK_SHADOW_OUT;
-    GtkStateType stateType = GTK_STATE_INSENSITIVE;
-    bool pressed = (part == scrollbar-&gt;pressedPart());
-
-    if ((BackButtonStartPart == part &amp;&amp; scrollbar-&gt;currentPos())
-        || (BackButtonEndPart == part &amp;&amp; scrollbar-&gt;currentPos())
-        || (ForwardButtonEndPart == part &amp;&amp; scrollbar-&gt;currentPos() != scrollbar-&gt;maximum())
-        || (ForwardButtonStartPart == part &amp;&amp; scrollbar-&gt;currentPos() != scrollbar-&gt;maximum())) {
-        stateType = GTK_STATE_NORMAL;
-        if (pressed) {
-            stateType = GTK_STATE_ACTIVE;
-            shadowType = GTK_SHADOW_IN;
-        } else if (part == scrollbar-&gt;hoveredPart())
-            stateType = GTK_STATE_PRELIGHT;
-    }
-
-    // Themes determine how to draw the button (which button to draw) based on the allocation
-    // of the widget. Where the target rect is in relation to the total widget allocation
-    // determines the button.
-    ScrollbarOrientation orientation = scrollbar-&gt;orientation();
-    int buttonSize = (orientation == VerticalScrollbar) ? rect.height() : rect.width();
-    int totalAllocation = buttonSize * 5; // One space for each button and one extra.
-    int buttonOffset = 0;
-    if (ForwardButtonStartPart == part)
-        buttonOffset = buttonSize;
-    else if (BackButtonEndPart == part)
-        buttonOffset = 3 * buttonSize;
-    else if (ForwardButtonEndPart == part)
-        buttonOffset = 4 * buttonSize;
-
-    // Now we want the allocation to be relative to the origin of the painted rect.
-    GtkWidget* widget = getWidgetForScrollbar(scrollbar);
-    GtkAllocation allocation;
-    gtk_widget_get_allocation(widget, &amp;allocation);
-    allocation.x = allocation.y = 0;
-    allocation.width = rect.width();
-    allocation.height = rect.height();
-
-    if (orientation == VerticalScrollbar) {
-        allocation.height = totalAllocation;
-        allocation.y -= buttonOffset;
-    } else {
-        allocation.width = totalAllocation;
-        allocation.x -= buttonOffset;
-    }
-    gtk_widget_set_allocation(widget, &amp;allocation);
-
-    const char* detail = orientation == VerticalScrollbar ? &quot;vscrollbar&quot; : &quot;hscrollbar&quot;;
-    WidgetRenderingContext widgetContext(context, rect);
-
-    IntRect buttonRect(IntPoint(), rect.size());
-    widgetContext.gtkPaintBox(buttonRect, widget, stateType, shadowType, detail);
-
-    float arrowScaling;
-    gtk_widget_style_get(widget, &quot;arrow-scaling&quot;, &amp;arrowScaling, NULL);
-    IntSize arrowSize = rect.size();
-    arrowSize.scale(arrowScaling);
-    IntRect arrowRect(IntPoint(buttonRect.x() + (buttonRect.width() - arrowSize.width()) / 2,
-                               buttonRect.y() + (buttonRect.height() - arrowSize.height()) / 2),
-                      arrowSize);
-    if (pressed) {
-        int arrowDisplacementX, arrowDisplacementY;
-        gtk_widget_style_get(widget,
-                             &quot;arrow-displacement-x&quot;, &amp;arrowDisplacementX,
-                             &quot;arrow-displacement-y&quot;, &amp;arrowDisplacementY,
-                             NULL);
-        arrowRect.move(arrowDisplacementX, arrowDisplacementY);
-    }
-
-    GtkArrowType arrowType = GTK_ARROW_DOWN;
-    if (orientation == VerticalScrollbar) {
-        if (part == BackButtonEndPart || part == BackButtonStartPart)
-            arrowType = GTK_ARROW_UP;
-    } else if (orientation == HorizontalScrollbar) {
-        arrowType = GTK_ARROW_RIGHT;
-        if (part == BackButtonEndPart || part == BackButtonStartPart)
-            arrowType = GTK_ARROW_LEFT;
-    }
-    widgetContext.gtkPaintArrow(arrowRect, widget, stateType, shadowType, arrowType, detail);
-}
-
-} // namespace WebCore
-
-#endif // GTK_API_VERSION_2
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkWidgetRenderingContextcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -1,249 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Sencha, Inc.
- * Copyright (C) 2010 Igalia S.L.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WidgetRenderingContext.h&quot;
-
-#ifdef GTK_API_VERSION_2
-
-#include &quot;GraphicsContext.h&quot;
-#include &quot;GtkVersioning.h&quot;
-#include &quot;PlatformContextCairo.h&quot;
-#include &quot;RefPtrCairo.h&quot;
-#include &quot;RenderThemeGtk.h&quot;
-#include &quot;Timer.h&quot;
-#include &lt;gdk/gdk.h&gt;
-#include &lt;gtk/gtk.h&gt;
-#include &lt;wtf/StdLibExtras.h&gt;
-
-namespace WebCore {
-
-static GdkPixmap* gScratchBuffer = 0;
-static void purgeScratchBuffer()
-{
-    if (gScratchBuffer)
-        g_object_unref(gScratchBuffer);
-    gScratchBuffer = 0;
-}
-
-// Widget rendering needs a scratch image as the buffer for the intermediate
-// render. Instead of creating and destroying the buffer for every operation,
-// we create a buffer which will be automatically purged via a timer.
-class PurgeScratchBufferTimer : public TimerBase {
-private:
-    virtual void fired() { purgeScratchBuffer(); }
-};
-
-static void scheduleScratchBufferPurge()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(PurgeScratchBufferTimer, purgeScratchBufferTimer, ());
-    if (purgeScratchBufferTimer.isActive())
-        purgeScratchBufferTimer.stop();
-    purgeScratchBufferTimer.startOneShot(2);
-}
-
-WidgetRenderingContext::WidgetRenderingContext(GraphicsContext* graphicsContext, const IntRect&amp; targetRect)
-    : m_graphicsContext(graphicsContext)
-    , m_targetRect(targetRect)
-    , m_hadError(false)
-{
-    RenderThemeGtk* theme = static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get());
-
-    // Fallback: We failed to create an RGBA colormap earlier, so we cannot properly paint 
-    // to a temporary surface and preserve transparency. To ensure decent widget rendering, just
-    // paint directly to the target drawable. This will not render CSS rotational transforms properly.
-    if (!theme-&gt;m_themePartsHaveRGBAColormap &amp;&amp; graphicsContext-&gt;gdkWindow()) {
-        m_target = graphicsContext-&gt;gdkWindow();
-        return;
-    }
-
-    // We never want to create a scratch buffer larger than the size of our target GdkDrawable.
-    // This prevents giant pixmap allocations for very large widgets in smaller views.
-    // FIXME: We need to implement this check for WebKit2 as well.
-    if (GdkDrawable* drawable = graphicsContext-&gt;gdkWindow()) {
-        int maxWidth = 0, maxHeight = 0;
-
-        if (GDK_IS_PIXMAP(drawable))
-            gdk_pixmap_get_size(GDK_PIXMAP(drawable), &amp;maxWidth, &amp;maxHeight);
-        else if (GDK_IS_WINDOW(drawable)) {
-            maxWidth = gdk_window_get_width(GDK_WINDOW(drawable));
-            maxHeight = gdk_window_get_height(GDK_WINDOW(drawable));
-        }
-        m_targetRect.setSize(m_targetRect.size().shrunkTo(IntSize(maxWidth, maxHeight)));
-    }
-
-    // Widgets sometimes need to draw outside their boundaries for things such as
-    // exterior focus. We want to allocate a some extra pixels in our surface for this.
-    static int extraSpace = 15;
-    m_targetRect.inflate(extraSpace);
-
-    // This offset will map a point in the coordinate system of the widget to the coordinate system of the painting buffer.
-    m_paintOffset = targetRect.location() - m_targetRect.location();
-
-    int width = m_targetRect.width() + (extraSpace * 2);
-    int height = m_targetRect.height() + (extraSpace * 2);
-    int scratchWidth = 0;
-    int scratchHeight = 0;
-    if (gScratchBuffer)
-        gdk_pixmap_get_size(gScratchBuffer, &amp;scratchWidth, &amp;scratchHeight);
-
-    // We do not need to recreate the buffer if the current buffer is large enough.
-    if (!gScratchBuffer || scratchWidth &lt; width || scratchHeight &lt; height) {
-        purgeScratchBuffer();
-        // Round to the nearest 32 pixels so we do not grow the buffer for similar sized requests.
-        width = (1 + (width &gt;&gt; 5)) &lt;&lt; 5;
-        height = (1 + (height &gt;&gt; 5)) &lt;&lt; 5;
-
-        gScratchBuffer = gdk_pixmap_new(0, width, height, gdk_colormap_get_visual(theme-&gt;m_colormap)-&gt;depth);
-        gdk_drawable_set_colormap(gScratchBuffer, theme-&gt;m_colormap);
-    }
-    m_target = gScratchBuffer;
-
-    // Clear the scratch buffer.
-    RefPtr&lt;cairo_t&gt; scratchBufferContext = adoptRef(gdk_cairo_create(gScratchBuffer));
-    cairo_set_operator(scratchBufferContext.get(), CAIRO_OPERATOR_CLEAR);
-    cairo_paint(scratchBufferContext.get());
-}
-
-WidgetRenderingContext::~WidgetRenderingContext()
-{
-    // We do not need to blit back to the target in the fallback case. See above.
-    RenderThemeGtk* theme = static_cast&lt;RenderThemeGtk*&gt;(RenderTheme::defaultTheme().get());
-    if (!theme-&gt;m_themePartsHaveRGBAColormap &amp;&amp; m_graphicsContext-&gt;gdkWindow())
-        return;
-
-    // Don't paint the results back if there was an error.
-    if (m_hadError) {
-        scheduleScratchBufferPurge();
-        return;
-    }
-
-    // FIXME: It's unclear if it is necessary to preserve the current source here.
-    cairo_t* cairoContext = m_graphicsContext-&gt;platformContext()-&gt;cr();
-    RefPtr&lt;cairo_pattern_t&gt; previousSource(cairo_get_source(cairoContext));
-
-    gdk_cairo_set_source_pixmap(cairoContext, gScratchBuffer, m_targetRect.x(), m_targetRect.y());
-    cairo_rectangle(cairoContext, m_targetRect.x(), m_targetRect.y(), m_targetRect.width(), m_targetRect.height());
-    cairo_fill(cairoContext);
-    cairo_set_source(cairoContext, previousSource.get());
-    scheduleScratchBufferPurge();
-}
-
-void WidgetRenderingContext::calculateClipRect(const IntRect&amp; rect, GdkRectangle* clipRect)
-{
-    clipRect-&gt;x = m_paintOffset.width() + rect.x();
-    clipRect-&gt;y = m_paintOffset.height() + rect.y();
-    clipRect-&gt;width = m_targetRect.width();
-    clipRect-&gt;height = m_targetRect.height();
-}
-
-void WidgetRenderingContext::gtkPaintBox(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-
-    // Some widgets also need their allocation adjusted to account for extra space.
-    // Right now only scrollbar buttons have significant allocations.
-    GtkAllocation allocation;
-    gtk_widget_get_allocation(widget, &amp;allocation);
-    allocation.x += clipRect.x;
-    allocation.y += clipRect.y;
-    gtk_widget_set_allocation(widget, &amp;allocation);
-
-    gtk_paint_box(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect,
-                  widget, detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintFlatBox(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_flat_box(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect,
-                       widget, detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintFocus(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_focus(gtk_widget_get_style(widget), m_target, stateType, &amp;clipRect, widget,
-                    detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintSlider(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail, GtkOrientation orientation)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_slider(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect, widget,
-                     detail, clipRect.x, clipRect.y, rect.width(), rect.height(), orientation);
-}
-
-void WidgetRenderingContext::gtkPaintCheck(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_check(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect, widget,
-                    detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintOption(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_option(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect, widget,
-                     detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintShadow(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_shadow(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect, widget,
-                     detail, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintArrow(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, int arrowDirection, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_arrow(gtk_widget_get_style(widget), m_target, stateType, shadowType, &amp;clipRect, widget, detail,
-                    static_cast&lt;GtkArrowType&gt;(arrowDirection), TRUE, clipRect.x, clipRect.y, rect.width(), rect.height());
-}
-
-void WidgetRenderingContext::gtkPaintVLine(const IntRect&amp; rect, GtkWidget* widget, GtkStateType stateType, const gchar* detail)
-{
-    GdkRectangle clipRect;
-    calculateClipRect(rect, &amp;clipRect);
-    gtk_paint_vline(gtk_widget_get_style(widget), m_target, stateType, &amp;clipRect, widget, detail,
-                    clipRect.y, clipRect.y + rect.height(), clipRect.x);
-
-}
-
-}
-
-#endif // GTK_API_VERSION_2
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkWidgetRenderingContexth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.h (173058 => 173059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.h        2014-08-28 08:02:46 UTC (rev 173058)
+++ trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.h        2014-08-28 09:13:58 UTC (rev 173059)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Igalia S.L.
- * All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WidgetRenderingContext_h
-#define WidgetRenderingContext_h
-
-#ifdef GTK_API_VERSION_2
-
-#include &quot;IntRect.h&quot;
-
-// Usually this is too expensive to have in headers, but GtkStateType GtkShadowType are
-// enums and cannot be forward declared. WidgetRenderingContext.h is currently only
-// included in RenderThemeGtk2.cpp and ScrollbarThemeGtk2.cpp.
-#include &lt;gtk/gtk.h&gt;
-
-namespace WebCore {
-
-class GraphicsContext;
-class RenderThemeGtk;
-
-class WidgetRenderingContext {
-public:
-    WidgetRenderingContext(GraphicsContext*, const IntRect&amp;);
-    ~WidgetRenderingContext();
-
-    void gtkPaintBox(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
-    void gtkPaintFlatBox(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
-    void gtkPaintFocus(const IntRect&amp;, GtkWidget*, GtkStateType, const gchar*);
-    void gtkPaintSlider(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*, GtkOrientation);
-    void gtkPaintCheck(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
-    void gtkPaintOption(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
-    void gtkPaintShadow(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
-    void gtkPaintArrow(const IntRect&amp;, GtkWidget*, GtkStateType, GtkShadowType, int arrowDirection, const gchar*);
-    void gtkPaintVLine(const IntRect&amp;, GtkWidget*, GtkStateType, const gchar*);
-
-private:
-    void calculateClipRect(const IntRect&amp;, GdkRectangle*);
-
-    GraphicsContext* m_graphicsContext;
-    IntRect m_targetRect;
-    IntSize m_paintOffset;
-    bool m_hadError;
-    GdkDrawable* m_target;
-
-};
-
-}
-
-#endif // GTK_API_VERSION_2
-#endif // WidgetRenderingContext_h
</del></span></pre>
</div>
</div>

</body>
</html>