[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

carlosgc at webkit.org carlosgc at webkit.org
Fri Jan 21 15:14:38 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit fb3a620f92117b58e209f11dd5e6bea5944d35a0
Author: carlosgc at webkit.org <carlosgc at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 10 17:00:47 2011 +0000

    2011-01-10  Carlos Garcia Campos  <cgarcia at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [GTK] Port text input control painting to GtkStyleContext
            https://bugs.webkit.org/show_bug.cgi?id=51870
    
            Use GtkStyleContext API to paint text input controls when building
            with GTK+ 3.x.
    
            No new tests. This should not change functionality.
    
            * platform/gtk/RenderThemeGtk3.cpp:
            (WebCore::RenderThemeGtk::adjustRepaintRect):
            (WebCore::RenderThemeGtk::paintTextField):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 59a1737..a1cd5e7 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-10  Carlos Garcia Campos  <cgarcia at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Port text input control painting to GtkStyleContext
+        https://bugs.webkit.org/show_bug.cgi?id=51870
+
+        Use GtkStyleContext API to paint text input controls when building
+        with GTK+ 3.x.
+
+        No new tests. This should not change functionality.
+
+        * platform/gtk/RenderThemeGtk3.cpp:
+        (WebCore::RenderThemeGtk::adjustRepaintRect):
+        (WebCore::RenderThemeGtk::paintTextField):
+
 2011-01-09  Tony Gentilcore  <tonyg at chromium.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
index 0e3011f..26ce72d 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
@@ -113,6 +113,7 @@ static void adjustRectForFocus(GtkStyleContext* context, IntRect& rect)
 void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
 {
     GtkStyleContext* context = 0;
+    bool checkInteriorFocus = false;
     ControlPart part = renderObject->style()->appearance();
     switch (part) {
     case SliderVerticalPart:
@@ -121,18 +122,24 @@ void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect
         break;
     case ButtonPart:
         context = getStyleContext(GTK_TYPE_BUTTON);
-
-        gboolean interiorFocus;
-        gtk_style_context_get_style(context, "interior-focus", &interiorFocus, NULL);
-        if (interiorFocus)
-            return;
-
+        checkInteriorFocus = true;
+        break;
+    case TextFieldPart:
+    case TextAreaPart:
+        context = getStyleContext(GTK_TYPE_ENTRY);
+        checkInteriorFocus = true;
         break;
     default:
         return;
     }
 
     ASSERT(context);
+    if (checkInteriorFocus) {
+        gboolean interiorFocus;
+        gtk_style_context_get_style(context, "interior-focus", &interiorFocus, NULL);
+        if (interiorFocus)
+            return;
+    }
     adjustRectForFocus(context, rect);
 }
 
@@ -335,9 +342,43 @@ bool RenderThemeGtk::paintMenuList(RenderObject* object, const PaintInfo& info,
     return paintRenderObject(MOZ_GTK_DROPDOWN, object, info.context, rect);
 }
 
-bool RenderThemeGtk::paintTextField(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    return paintRenderObject(MOZ_GTK_ENTRY, object, info.context, rect);
+    GtkStyleContext* context = getStyleContext(GTK_TYPE_ENTRY);
+    gtk_style_context_save(context);
+
+    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction())));
+    gtk_style_context_add_class(context, GTK_STYLE_CLASS_ENTRY);
+
+    guint flags = 0;
+    if (!isEnabled(renderObject) || isReadOnlyControl(renderObject))
+        flags |= GTK_STATE_FLAG_INSENSITIVE;
+    else if (isFocused(renderObject))
+        flags |= GTK_STATE_FLAG_FOCUSED;
+    gtk_style_context_set_state(context, static_cast<GtkStateFlags>(flags));
+
+    gtk_render_background(context, paintInfo.context->platformContext(), rect.x(), rect.y(), rect.width(), rect.height());
+    gtk_render_frame(context, paintInfo.context->platformContext(), rect.x(), rect.y(), rect.width(), rect.height());
+
+    if (isFocused(renderObject) && isEnabled(renderObject)) {
+        gboolean interiorFocus;
+        gint focusWidth, focusPad;
+        gtk_style_context_get_style(context,
+                                    "interior-focus", &interiorFocus,
+                                    "focus-line-width", &focusWidth,
+                                    "focus-padding", &focusPad,
+                                    NULL);
+        if (!interiorFocus) {
+            IntRect focusRect(rect);
+            focusRect.inflate(focusWidth + focusPad);
+            gtk_render_focus(context, paintInfo.context->platformContext(),
+                             focusRect.x(), focusRect.y(), focusRect.width(), focusRect.height());
+        }
+    }
+
+    gtk_style_context_restore(context);
+
+    return false;
 }
 
 bool RenderThemeGtk::paintSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list