summaryrefslogtreecommitdiff
path: root/mozilla-1160154.patch
blob: 8971fbb870eeb1377b1aa71286d19b1192cbf560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff --git a/widget/gtk/gtk3drawing.c b/widget/gtk/gtk3drawing.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -72,16 +72,19 @@ static gboolean is_initialized;
 #define ARROW_DOWN    G_PI
 #define ARROW_RIGHT   G_PI_2
 #define ARROW_LEFT    (G_PI+G_PI_2)
 
 #if !GTK_CHECK_VERSION(3,14,0)
 #define GTK_STATE_FLAG_CHECKED (1 << 11)
 #endif
 
+// See Bug 1160154 for details
+#define MAX_WIDGET_PADDING 6
+
 static GtkStateFlags
 GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
 {
     GtkStateFlags stateFlags = GTK_STATE_FLAG_NORMAL;
 
     if (state->disabled)
         stateFlags = GTK_STATE_FLAG_INSENSITIVE;
     else {    
@@ -2590,22 +2593,22 @@ moz_gtk_add_style_border(GtkStyleContext
 }
 
 static void
 moz_gtk_add_style_padding(GtkStyleContext* style,
                           gint* left, gint* top, gint* right, gint* bottom)
 {
     GtkBorder padding;
 
-    gtk_style_context_get_padding(style, 0, &padding);
-
-    *left += padding.left;
-    *right += padding.right;
-    *top += padding.top;
-    *bottom += padding.bottom;
+    gtk_style_context_get_padding(style, 0, &padding);	
+
+    *left += (padding.left > MAX_WIDGET_PADDING) ? MAX_WIDGET_PADDING : padding.left;
+    *right += (padding.right > MAX_WIDGET_PADDING) ? MAX_WIDGET_PADDING : padding.right;
+    *top += (padding.top > MAX_WIDGET_PADDING) ? MAX_WIDGET_PADDING : padding.top;
+    *bottom += (padding.bottom > MAX_WIDGET_PADDING) ? MAX_WIDGET_PADDING : padding.bottom;
 }
 
 gint
 moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
                           gint* right, gint* bottom, GtkTextDirection direction,
                           gboolean inhtml)
 {
     GtkWidget* w;
    
bgstack15