From 58d2070b38d16348ee3027580d0cbbf88157cc4a7109e24572d9e232b7ee29ef Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Tue, 12 Apr 2016 21:13:00 +0000 Subject: [PATCH 01/12] - Compile against gtk3 depending on whether the macro %firefox_use_gtk3 is defined or not (e.g., at the prjconf level); macro is undefined by default and so gtk2 is used as the default toolkit. - Add BuildRequires for additional packages needed when building against gtk3: pkgconfig(glib-2.0), pkgconfig(gobject-2.0), pkgconfig(gtk+-3.0) >= 3.4.0, pkgconfig(gtk+-unix-print-3.0). - Add firefox-gtk3_20.patch to fix appearance with gtk3 >= 3.20; patch taken from Fedora (bmo#1230955). OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=496 --- MozillaFirefox.changes | 13 + MozillaFirefox.spec | 20 +- mozilla-gtk3_20.patch | 1627 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1655 insertions(+), 5 deletions(-) create mode 100644 mozilla-gtk3_20.patch diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index 6c03ac8..f318ba3 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Apr 12 19:11:30 UTC 2016 - badshah400@gmail.com + +- Compile against gtk3 depending on whether the macro + %firefox_use_gtk3 is defined or not (e.g., at the prjconf + level); macro is undefined by default and so gtk2 is used as the + default toolkit. +- Add BuildRequires for additional packages needed when building + against gtk3: pkgconfig(glib-2.0), pkgconfig(gobject-2.0), + pkgconfig(gtk+-3.0) >= 3.4.0, pkgconfig(gtk+-unix-print-3.0). +- Add firefox-gtk3_20.patch to fix appearance with gtk3 >= 3.20; + patch taken from Fedora (bmo#1230955). + ------------------------------------------------------------------- Mon Apr 11 22:49:24 UTC 2016 - astieger@suse.com diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 4bff245..9b27861 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -91,6 +91,12 @@ BuildRequires: pkgconfig(gstreamer-%gstreamer_ver) BuildRequires: pkgconfig(gstreamer-app-%gstreamer_ver) BuildRequires: pkgconfig(gstreamer-plugins-base-%gstreamer_ver) BuildRequires: pkgconfig(libpulse) +%if 0%{?firefox_use_gtk3} +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0 +BuildRequires: pkgconfig(gtk+-unix-print-3.0) +%endif # libavcodec is already used if available for H.264 but # explicitely loaded by FF. For proper H.264 support the # openSUSE delivered version is not sufficient but currently @@ -160,6 +166,7 @@ Patch8: mozilla-openaes-decl.patch Patch10: mozilla-no-stdcxx-check.patch Patch11: mozilla-libproxy.patch Patch12: mozilla-reduce-files-per-UnifiedBindings.patch +Patch13: mozilla-gtk3_20.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-no-default-ualocale.patch @@ -270,6 +277,9 @@ cd $RPM_BUILD_DIR/mozilla %patch10 -p1 %patch11 -p1 %patch12 -p1 +%if 0%{?firefox_use_gtk3} +%patch13 -p1 +%endif # Firefox %patch101 -p1 %patch102 -p1 @@ -322,8 +332,8 @@ ac_add_options --sysconfdir=%{_sysconfdir} ac_add_options --mandir=%{_mandir} ac_add_options --includedir=%{_includedir} ac_add_options --enable-release -%if 0%{?suse_version} > 1320 -#ac_add_options --enable-default-toolkit=cairo-gtk3 +%if 0%{?firefox_use_gtk3} +ac_add_options --enable-default-toolkit=cairo-gtk3 %endif %ifarch %ix86 %arm %if 0%{?suse_version} > 1230 @@ -573,9 +583,9 @@ exit 0 %{progdir}/distribution/extensions/ %{progdir}/defaults/ %{progdir}/dictionaries/ -%if 0%{?suse_version} > 1320 -#%dir %{progdir}/gtk2 -#%{progdir}/gtk2/libmozgtk.so +%if 0%{?firefox_use_gtk3} +%dir %{progdir}/gtk2 +%{progdir}/gtk2/libmozgtk.so %endif %{progdir}/webapprt/ %{progdir}/gmp-clearkey/ diff --git a/mozilla-gtk3_20.patch b/mozilla-gtk3_20.patch new file mode 100644 index 0000000..63da60c --- /dev/null +++ b/mozilla-gtk3_20.patch @@ -0,0 +1,1627 @@ +diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/gtk/gtk3drawing.c +--- firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 2016-03-15 23:37:46.000000000 +0100 ++++ firefox-45.0.1/widget/gtk/gtk3drawing.c 2016-04-05 14:40:27.846088625 +0200 +@@ -17,32 +17,78 @@ + + #include + ++#define MOZ_WIDGET_STYLES 4 ++ ++typedef struct { ++ GtkWidget* widget; ++ ++ union { ++ struct { ++ GtkStyleContext* style; ++ GtkStyleContext* styleSelection; ++ } entry; ++ ++ struct { ++ GtkStyleContext* style; ++ } button; ++ ++ struct { ++ GtkStyleContext* style; ++ GtkStyleContext* styleTrough; ++ GtkStyleContext* styleSlider; ++ } scroll; ++ ++ struct { ++ GtkStyleContext* style; ++ GtkStyleContext* styleCheck; ++ GtkStyleContext* styleLabel; ++ } check; ++ ++ struct { ++ GtkStyleContext* style; ++ GtkStyleContext* styleTrough; ++ GtkStyleContext* styleProgress; ++ } progress; ++ ++ struct { ++ GtkStyleContext* style; ++ GtkStyleContext* styleEntry; ++ GtkStyleContext* styleButtonUp; ++ GtkStyleContext* styleButtonDown; ++ } spin; ++ ++ struct { ++ GtkStyleContext* style[MOZ_WIDGET_STYLES]; ++ } all; ++ }; ++} MozGtkWidget; ++ + static GtkWidget* gProtoWindow; + static GtkWidget* gProtoLayout; +-static GtkWidget* gButtonWidget; ++static MozGtkWidget gButton; + static GtkWidget* gToggleButtonWidget; + static GtkWidget* gButtonArrowWidget; +-static GtkWidget* gCheckboxWidget; +-static GtkWidget* gRadiobuttonWidget; +-static GtkWidget* gHorizScrollbarWidget; +-static GtkWidget* gVertScrollbarWidget; +-static GtkWidget* gSpinWidget; ++static MozGtkWidget gCheckbox; ++static MozGtkWidget gRadiobutton; ++static MozGtkWidget gVertScrollbar; ++static MozGtkWidget gHorizScrollbar; ++static MozGtkWidget gSpin; + static GtkWidget* gHScaleWidget; + static GtkWidget* gVScaleWidget; +-static GtkWidget* gEntryWidget; ++static MozGtkWidget gEntry; + static GtkWidget* gComboBoxWidget; + static GtkWidget* gComboBoxButtonWidget; + static GtkWidget* gComboBoxArrowWidget; + static GtkWidget* gComboBoxSeparatorWidget; + static GtkWidget* gComboBoxEntryWidget; +-static GtkWidget* gComboBoxEntryTextareaWidget; ++static MozGtkWidget gComboBoxEntryTextarea; + static GtkWidget* gComboBoxEntryButtonWidget; + static GtkWidget* gComboBoxEntryArrowWidget; + static GtkWidget* gHandleBoxWidget; + static GtkWidget* gToolbarWidget; + static GtkWidget* gFrameWidget; + static GtkWidget* gStatusbarWidget; +-static GtkWidget* gProgressWidget; ++static MozGtkWidget gProgressBar; + static GtkWidget* gTabWidget; + static GtkWidget* gTooltipWidget; + static GtkWidget* gMenuBarWidget; +@@ -78,6 +124,37 @@ static gboolean is_initialized; + #define GTK_STATE_FLAG_CHECKED (1 << 11) + #endif + ++void moz_gtk_widget_free(MozGtkWidget *aMozWidget) ++{ ++ // This was removed as a child of gProtoWindow ++ if (aMozWidget->widget) { ++ aMozWidget->widget = NULL; ++ } ++ ++ for(int i = 0; i < MOZ_WIDGET_STYLES; i++) { ++ if (aMozWidget->all.style[i]) { ++ g_object_unref(aMozWidget->all.style[i]); ++ aMozWidget->all.style[i] = NULL; ++ } ++ } ++} ++ ++// TODO - weak dep!! (dlsym) ++#if GTK_CHECK_VERSION(3, 19, 2) ++#define moz_gtk_path_set_class_name gtk_widget_path_iter_set_object_name ++#else ++#define moz_gtk_path_set_class_name gtk_widget_path_iter_add_class ++#endif ++//gtk_widget_path_iter_get_state ++ ++static void ++moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags, ++ GtkBorder *border); ++ ++static void ++moz_gtk_get_style_padding(GtkStyleContext* style, GtkStateFlags state_flags, ++ GtkBorder *padding); ++ + static GtkStateFlags + GetStateFlagsFromGtkWidgetState(GtkWidgetState* state) + { +@@ -97,6 +174,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge + return stateFlags; + } + ++GtkStyleContext * ++moz_gtk_style_create(GtkCssNode *node, GtkStyleContext *parent) ++{ ++ GtkWidgetPath *path; ++ GtkStyleContext *context; ++ ++ if (parent) ++ path = gtk_widget_path_copy (gtk_style_context_get_path (parent)); ++ else ++ path = gtk_widget_path_new (); ++ ++ gtk_widget_path_append_type (path, node->type); ++ if (node->name) ++ moz_gtk_path_set_class_name(path, -1, node->name); ++ if (node->class1) ++ gtk_widget_path_iter_add_class(path, -1, node->class1); ++ if (node->class2) ++ gtk_widget_path_iter_add_class(path, -1, node->class2); ++ ++ context = gtk_style_context_new (); ++ gtk_style_context_set_path (context, path); ++ gtk_style_context_set_parent (context, parent); ++ ++ if(!gtk_check_version(3, 14, 0)) { ++ /* Unfortunately, we have to explicitly set the state again here ++ * for it to take effect ++ */ ++ gtk_style_context_set_state (context, gtk_widget_path_iter_get_state (path, -1)); ++ } ++ ++ gtk_widget_path_unref (path); ++ ++ return context; ++} ++ + /* Because we have such an unconventional way of drawing widgets, signal to the GTK theme engine + that they are drawing for Mozilla instead of a conventional GTK app so they can do any specific + things they may want to do. */ +@@ -141,9 +253,16 @@ setup_widget_prototype(GtkWidget* widget + static gint + ensure_button_widget() + { +- if (!gButtonWidget) { +- gButtonWidget = gtk_button_new_with_label("M"); +- setup_widget_prototype(gButtonWidget); ++ if (!gButton.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_BUTTON, "button", NULL, NULL } ++ }; ++ ++ gButton.widget = gtk_button_new_with_label("M"); ++ setup_widget_prototype(gButton.widget); ++ gtk_widget_show(gButton.widget); ++ ++ gButton.button.style = moz_gtk_style_create(&path[0], NULL); + } + return MOZ_GTK_SUCCESS; + } +@@ -195,9 +314,21 @@ ensure_button_arrow_widget() + static gint + ensure_checkbox_widget() + { +- if (!gCheckboxWidget) { +- gCheckboxWidget = gtk_check_button_new_with_label("M"); +- setup_widget_prototype(gCheckboxWidget); ++ if (!gCheckbox.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_TOGGLE_BUTTON, "checkbutton", NULL, NULL }, ++ { G_TYPE_NONE, "check", NULL, NULL }, ++ { G_TYPE_NONE, "label", NULL, NULL } ++ }; ++ ++ gCheckbox.widget = gtk_check_button_new_with_label("M"); ++ setup_widget_prototype(gCheckbox.widget); ++ ++ gCheckbox.check.style = moz_gtk_style_create(&path[0], NULL); ++ gCheckbox.check.styleCheck = moz_gtk_style_create(&path[1], ++ gCheckbox.check.style); ++ gCheckbox.check.styleLabel = moz_gtk_style_create(&path[2], ++ gCheckbox.check.style); + } + return MOZ_GTK_SUCCESS; + } +@@ -205,9 +336,21 @@ ensure_checkbox_widget() + static gint + ensure_radiobutton_widget() + { +- if (!gRadiobuttonWidget) { +- gRadiobuttonWidget = gtk_radio_button_new_with_label(NULL, "M"); +- setup_widget_prototype(gRadiobuttonWidget); ++ if (!gRadiobutton.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_TOGGLE_BUTTON, "radiobutton", NULL, NULL }, ++ { G_TYPE_NONE, "radio", NULL, NULL }, ++ { G_TYPE_NONE, "label", NULL, NULL } ++ }; ++ ++ gRadiobutton.widget = gtk_radio_button_new_with_label(NULL, "M"); ++ setup_widget_prototype(gRadiobutton.widget); ++ ++ gRadiobutton.check.style = moz_gtk_style_create(&path[0], NULL); ++ gRadiobutton.check.styleCheck = moz_gtk_style_create(&path[1], ++ gRadiobutton.check.style); ++ gRadiobutton.check.styleLabel = moz_gtk_style_create(&path[2], ++ gRadiobutton.check.style); + } + return MOZ_GTK_SUCCESS; + } +@@ -215,13 +358,31 @@ ensure_radiobutton_widget() + static gint + ensure_scrollbar_widget() + { +- if (!gVertScrollbarWidget) { +- gVertScrollbarWidget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL); +- setup_widget_prototype(gVertScrollbarWidget); +- } +- if (!gHorizScrollbarWidget) { +- gHorizScrollbarWidget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL); +- setup_widget_prototype(gHorizScrollbarWidget); ++ if (!gVertScrollbar.widget && !gHorizScrollbar.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", NULL }, ++ { GTK_TYPE_SCROLLBAR, "scrollbar", "vertical", NULL }, ++ { GTK_TYPE_SCROLLBAR, "trough", NULL, NULL }, ++ { GTK_TYPE_SCROLLBAR, "slider", NULL, NULL } ++ }; ++ ++ gVertScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL); ++ setup_widget_prototype(gVertScrollbar.widget); ++ ++ gVertScrollbar.scroll.style = moz_gtk_style_create(path+1, NULL); ++ gVertScrollbar.scroll.styleTrough = moz_gtk_style_create(path+2, ++ gVertScrollbar.scroll.style); ++ gVertScrollbar.scroll.styleSlider = moz_gtk_style_create(path+3, ++ gVertScrollbar.scroll.styleTrough); ++ ++ gHorizScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL); ++ setup_widget_prototype(gHorizScrollbar.widget); ++ ++ gHorizScrollbar.scroll.style = moz_gtk_style_create(path, NULL); ++ gHorizScrollbar.scroll.styleTrough = moz_gtk_style_create(path+2, ++ gHorizScrollbar.scroll.style); ++ gHorizScrollbar.scroll.styleSlider = moz_gtk_style_create(path+3, ++ gHorizScrollbar.scroll.styleTrough); + } + return MOZ_GTK_SUCCESS; + } +@@ -229,11 +390,24 @@ ensure_scrollbar_widget() + static gint + ensure_spin_widget() + { +- if (!gSpinWidget) { +- gSpinWidget = gtk_spin_button_new(NULL, 1, 0); +- setup_widget_prototype(gSpinWidget); +- } +- return MOZ_GTK_SUCCESS; ++ if (!gSpin.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_SPIN_BUTTON, "spinbutton", "horizontal", NULL }, ++ { GTK_TYPE_SPIN_BUTTON, "spinbutton", "vertical", NULL }, ++ { GTK_TYPE_ENTRY, "entry", NULL, NULL }, ++ { G_TYPE_NONE, "button", "up", NULL }, ++ { G_TYPE_NONE, "button", "down", NULL } ++ }; ++ ++ gSpin.widget = gtk_spin_button_new(NULL, 1, 0); ++ setup_widget_prototype(gSpin.widget); ++ ++ gSpin.spin.style = moz_gtk_style_create(path, NULL); ++ gSpin.spin.styleButtonUp = moz_gtk_style_create(path+3, gSpin.spin.style); ++ gSpin.spin.styleButtonDown = moz_gtk_style_create(path+4, gSpin.spin.style); ++ gSpin.spin.styleEntry = moz_gtk_style_create(path+2, gSpin.spin.style); ++ } ++ return MOZ_GTK_SUCCESS; + } + + static gint +@@ -253,9 +427,19 @@ ensure_scale_widget() + static gint + ensure_entry_widget() + { +- if (!gEntryWidget) { +- gEntryWidget = gtk_entry_new(); +- setup_widget_prototype(gEntryWidget); ++ if (!gEntry.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_ENTRY, "entry", NULL, NULL }, ++ { G_TYPE_NONE, "selection", NULL, NULL } ++ }; ++ ++ gEntry.widget = gtk_entry_new(); ++ setup_widget_prototype(gEntry.widget); ++ gtk_widget_show(gEntry.widget); ++ ++ gEntry.entry.style = moz_gtk_style_create(&path[0], NULL); ++ gEntry.entry.styleSelection = moz_gtk_style_create(&path[1], ++ gEntry.entry.style); + } + return MOZ_GTK_SUCCESS; + } +@@ -387,9 +571,9 @@ moz_gtk_get_combo_box_entry_inner_widget + g_object_add_weak_pointer(G_OBJECT(widget), + (gpointer) &gComboBoxEntryButtonWidget); + } else if (GTK_IS_ENTRY(widget)) { +- gComboBoxEntryTextareaWidget = widget; ++ gComboBoxEntryTextarea.widget = widget; + g_object_add_weak_pointer(G_OBJECT(widget), +- (gpointer) &gComboBoxEntryTextareaWidget); ++ (gpointer) &gComboBoxEntryTextarea.widget); + } else + return; + gtk_widget_realize(widget); +@@ -411,7 +595,7 @@ ensure_combo_box_entry_widgets() + { + GtkWidget* buttonChild; + +- if (gComboBoxEntryTextareaWidget && ++ if (gComboBoxEntryTextarea.widget && + gComboBoxEntryButtonWidget && + gComboBoxEntryArrowWidget) + return MOZ_GTK_SUCCESS; +@@ -427,9 +611,9 @@ ensure_combo_box_entry_widgets() + moz_gtk_get_combo_box_entry_inner_widgets, + NULL); + +- if (!gComboBoxEntryTextareaWidget) { ++ if (!gComboBoxEntryTextarea.widget) { + ensure_entry_widget(); +- gComboBoxEntryTextareaWidget = gEntryWidget; ++ gComboBoxEntryTextarea.widget = gEntry.widget; + } + + if (gComboBoxEntryButtonWidget) { +@@ -528,9 +712,21 @@ ensure_tab_widget() + static gint + ensure_progress_widget() + { +- if (!gProgressWidget) { +- gProgressWidget = gtk_progress_bar_new(); +- setup_widget_prototype(gProgressWidget); ++ if (!gProgressBar.widget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_LABEL, "progressbar", NULL, NULL }, ++ { G_TYPE_NONE, "trough", NULL, NULL }, ++ { G_TYPE_NONE, "progress", NULL, NULL }, ++ }; ++ ++ gProgressBar.widget = gtk_progress_bar_new(); ++ setup_widget_prototype(gProgressBar.widget); ++ ++ gProgressBar.progress.style = moz_gtk_style_create(&path[0], NULL); ++ gProgressBar.progress.styleTrough = moz_gtk_style_create(&path[1], ++ gProgressBar.progress.style); ++ gProgressBar.progress.styleProgress = moz_gtk_style_create(&path[2], ++ gProgressBar.progress.styleTrough); + } + return MOZ_GTK_SUCCESS; + } +@@ -636,6 +832,11 @@ static gint + ensure_check_menu_item_widget() + { + if (!gCheckMenuItemWidget) { ++ GtkCssNode path[] = { ++ { GTK_TYPE_CHECK_MENU_ITEM, "menuitem", NULL, NULL }, ++ { G_TYPE_NONE, "check", NULL, NULL } ++ }; ++ + ensure_menu_popup_widget(); + gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); + gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), +@@ -757,7 +958,7 @@ moz_gtk_checkbox_get_metrics(gint* indic + { + ensure_checkbox_widget(); + +- gtk_widget_style_get (gCheckboxWidget, ++ gtk_widget_style_get (gCheckbox.widget, + "indicator_size", indicator_size, + "indicator_spacing", indicator_spacing, + NULL); +@@ -770,7 +971,7 @@ moz_gtk_radio_get_metrics(gint* indicato + { + ensure_radiobutton_widget(); + +- gtk_widget_style_get (gRadiobuttonWidget, ++ gtk_widget_style_get (gRadiobutton.widget, + "indicator_size", indicator_size, + "indicator_spacing", indicator_spacing, + NULL); +@@ -783,13 +984,12 @@ moz_gtk_get_focus_outline_size(gint* foc + { + GtkBorder border; + GtkBorder padding; +- GtkStyleContext *style; ++ GtkStyleContext* style = gEntry.entry.style; + + ensure_entry_widget(); +- style = gtk_widget_get_style_context(gEntryWidget); + +- gtk_style_context_get_border(style, 0, &border); +- gtk_style_context_get_padding(style, 0, &padding); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + *focus_h_width = border.left + padding.left; + *focus_v_width = border.top + padding.top; + return MOZ_GTK_SUCCESS; +@@ -826,7 +1026,7 @@ moz_gtk_button_get_default_overflow(gint + GtkBorder* default_outside_border; + + ensure_button_widget(); +- gtk_widget_style_get(gButtonWidget, ++ gtk_widget_style_get(gButton.widget, + "default-outside-border", &default_outside_border, + NULL); + +@@ -849,7 +1049,7 @@ moz_gtk_button_get_default_border(gint* + GtkBorder* default_border; + + ensure_button_widget(); +- gtk_widget_style_get(gButtonWidget, ++ gtk_widget_style_get(gButton.widget, + "default-border", &default_border, + NULL); + +@@ -940,7 +1140,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec + + if (state->focused) { + GtkBorder border; +- gtk_style_context_get_border(style, state_flags, &border); ++ moz_gtk_get_style_border(style, state_flags, &border); + x += border.left; + y += border.top; + width -= (border.left + border.right); +@@ -961,15 +1161,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec + gint indicator_size, indicator_spacing; + gint x, y, width, height; + gint focus_x, focus_y, focus_width, focus_height; +- GtkWidget *w; +- GtkStyleContext *style; ++ MozGtkWidget *w; + + if (isradio) { + moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing); +- w = gRadiobuttonWidget; ++ w = &gRadiobutton; + } else { + moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing); +- w = gCheckboxWidget; ++ w = &gCheckbox; + } + + // XXX we should assert rect->height >= indicator_size too +@@ -988,11 +1187,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec + focus_width = width + 2 * indicator_spacing; + focus_height = height + 2 * indicator_spacing; + +- style = gtk_widget_get_style_context(w); +- +- gtk_widget_set_sensitive(w, !state->disabled); +- gtk_widget_set_direction(w, direction); +- gtk_style_context_save(style); ++ gtk_widget_set_sensitive(w->widget, !state->disabled); ++ gtk_widget_set_direction(w->widget, direction); ++ gtk_style_context_save(w->check.styleCheck); + + if (selected) + state_flags |= checkbox_check_state; +@@ -1000,13 +1197,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec + if (inconsistent) + state_flags |= GTK_STATE_FLAG_INCONSISTENT; + +- gtk_style_context_set_state(style, state_flags); ++ gtk_style_context_set_state(w->check.styleCheck, state_flags); ++ ++ gtk_render_background(w->check.styleCheck, cr, x, y, width, height); ++ gtk_render_frame(w->check.styleCheck, cr, x, y, width, height); + + if (isradio) { +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO); +- gtk_render_option(style, cr, x, y, width, height); ++ gtk_render_option(w->check.styleCheck, cr, x, y, width, height); + if (state->focused) { +- gtk_render_focus(style, cr, focus_x, focus_y, ++ gtk_render_focus(w->check.styleCheck, cr, focus_x, focus_y, + focus_width, focus_height); + } + } +@@ -1015,15 +1214,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec + * 'indeterminate' type on checkboxes. In GTK, the shadow type + * must also be changed for the state to be drawn. + */ +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK); +- gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), inconsistent); +- gtk_render_check(style, cr, x, y, width, height); ++ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(w->widget), inconsistent); ++ gtk_render_check(w->check.styleCheck, cr, x, y, width, height); + if (state->focused) { +- gtk_render_focus(style, cr, ++ gtk_render_focus(w->check.styleCheck, cr, + focus_x, focus_y, focus_width, focus_height); + } + } +- gtk_style_context_restore(style); ++ gtk_style_context_restore(w->check.styleCheck); + + return MOZ_GTK_SUCCESS; + } +@@ -1040,8 +1238,8 @@ calculate_button_inner_rect(GtkWidget* b + style = gtk_widget_get_style_context(button); + + /* This mirrors gtkbutton's child positioning */ +- gtk_style_context_get_border(style, 0, &border); +- gtk_style_context_get_padding(style, 0, &padding); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + + inner_rect->x = rect->x + border.left + padding.left; + inner_rect->y = rect->y + padding.top + border.top; +@@ -1107,9 +1305,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * + ensure_scrollbar_widget(); + + if (flags & MOZ_GTK_STEPPER_VERTICAL) +- scrollbar = gVertScrollbarWidget; ++ scrollbar = gVertScrollbar.widget; + else +- scrollbar = gHorizScrollbarWidget; ++ scrollbar = gHorizScrollbar.widget; + + gtk_widget_set_direction(scrollbar, direction); + +@@ -1175,26 +1373,23 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW + GtkTextDirection direction) + { + GtkStyleContext* style; +- GtkScrollbar *scrollbar; + + ensure_scrollbar_widget(); + +- if (widget == MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL) +- scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget); +- else +- scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); +- +- gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); ++ if (widget == MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL) { ++ gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction); ++ style = gHorizScrollbar.scroll.styleTrough; ++ } ++ else { ++ gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction); ++ style = gVertScrollbar.scroll.styleTrough; ++ } + + if (flags & MOZ_GTK_TRACK_OPAQUE) { + style = gtk_widget_get_style_context(GTK_WIDGET(gProtoWindow)); + gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); + } + +- style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar)); +- gtk_style_context_save(style); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); +- + gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); + gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); + +@@ -1202,7 +1397,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW + gtk_render_focus(style, cr, + rect->x, rect->y, rect->width, rect->height); + } +- gtk_style_context_restore(style); + return MOZ_GTK_SUCCESS; + } + +@@ -1214,25 +1408,21 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi + { + GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); + GtkStyleContext* style; +- GtkScrollbar *scrollbar; + GtkAdjustment *adj; + GtkBorder margin; + + ensure_scrollbar_widget(); + +- if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) +- scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget); +- else +- scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); +- +- gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); +- +- style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar)); +- gtk_style_context_save(style); ++ if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) { ++ style = gHorizScrollbar.scroll.styleSlider; ++ gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction); ++ } ++ else { ++ style = gVertScrollbar.scroll.styleSlider; ++ gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction); ++ } + +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_SLIDER); + gtk_style_context_set_state(style, state_flags); +- + gtk_style_context_get_margin (style, state_flags, &margin); + + gtk_render_slider(style, cr, +@@ -1243,8 +1433,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi + (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ? + GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); + +- gtk_style_context_restore(style); +- + return MOZ_GTK_SUCCESS; + } + +@@ -1255,8 +1443,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta + GtkStyleContext* style; + + ensure_spin_widget(); +- gtk_widget_set_direction(gSpinWidget, direction); +- style = gtk_widget_get_style_context(gSpinWidget); ++ gtk_widget_set_direction(gSpin.widget, direction); ++ style = gSpin.spin.style; + gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); + gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); +@@ -1275,11 +1463,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G + GtkStyleContext* style; + + ensure_spin_widget(); +- style = gtk_widget_get_style_context(gSpinWidget); ++ style = gSpin.spin.style; + gtk_style_context_save(style); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); + gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state)); +- gtk_widget_set_direction(gSpinWidget, direction); ++ gtk_widget_set_direction(gSpin.widget, direction); + + gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); + gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); +@@ -1445,15 +1632,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec + static gint + moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect, + GtkWidgetState* state, +- GtkWidget* widget, GtkTextDirection direction) ++ MozGtkWidget* w, GtkTextDirection direction) + { + gint x = rect->x, y = rect->y, width = rect->width, height = rect->height; +- GtkStyleContext* style; + int draw_focus_outline_only = state->depressed; // NS_THEME_FOCUS_OUTLINE ++ GtkStyleContext* style = w->entry.style; + +- gtk_widget_set_direction(widget, direction); +- +- style = gtk_widget_get_style_context(widget); ++ gtk_widget_set_direction(w->widget, direction); + + if (draw_focus_outline_only) { + // Inflate the given 'rect' with the focus outline size. +@@ -1473,10 +1658,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect + * textarea window uses gtk_paint_flat_box when exposed */ + + /* This gets us a lovely greyish disabledish look */ +- gtk_widget_set_sensitive(widget, !state->disabled); ++ gtk_widget_set_sensitive(w->widget, !state->disabled); + + gtk_style_context_save(style); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_ENTRY); + + /* Now paint the shadow and focus border. + * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad +@@ -1526,7 +1710,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR + style = gtk_widget_get_style_context(gScrolledWindowWidget); + gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME); +- gtk_style_context_get_border(style, state_flags, &border); ++ moz_gtk_get_style_border(style, state_flags, &border); + xthickness = border.left; + ythickness = border.top; + +@@ -1697,7 +1881,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk + if (direction == GTK_TEXT_DIR_LTR) { + GtkBorder padding; + GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); +- gtk_style_context_get_padding(style, state_flags, &padding); ++ moz_gtk_get_style_padding(style, state_flags, &padding); + arrow_rect.x -= padding.left; + } + else +@@ -1799,29 +1983,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk + gboolean isradio, GtkTextDirection direction) + { + GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); +- GtkStyleContext* style; +- GtkWidget *widget; ++ MozGtkWidget *widget; + + if (isradio) { + ensure_radiobutton_widget(); +- widget = gRadiobuttonWidget; ++ widget = &gRadiobutton; + } else { + ensure_checkbox_widget(); +- widget = gCheckboxWidget; ++ widget = &gCheckbox; + } +- gtk_widget_set_direction(widget, direction); ++ gtk_widget_set_direction(widget->widget, direction); + +- style = gtk_widget_get_style_context(widget); +- gtk_style_context_save(style); +- gtk_style_context_set_state(style, state_flags); ++ gtk_style_context_save(widget->check.style); ++ gtk_style_context_set_state(widget->check.style, state_flags); + + /* this is for drawing a prelight box */ + if (state_flags & GTK_STATE_FLAG_PRELIGHT) { +- gtk_render_background(style, cr, ++ gtk_render_background(widget->check.style, cr, + rect->x, rect->y, rect->width, rect->height); + } + +- gtk_style_context_restore(style); ++ gtk_style_context_restore(widget->check.style); + + return MOZ_GTK_SUCCESS; + } +@@ -1831,32 +2013,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr, + GtkWidgetState* state, + gboolean isradio, GtkTextDirection direction) + { +- GtkStyleContext *style; +- GtkWidget *widget; ++ MozGtkWidget *widget; + + if (!state->focused) + return MOZ_GTK_SUCCESS; + + if (isradio) { + ensure_radiobutton_widget(); +- widget = gRadiobuttonWidget; ++ widget = &gRadiobutton; + } else { + ensure_checkbox_widget(); +- widget = gCheckboxWidget; +- } +- style = gtk_widget_get_style_context(widget); +- gtk_style_context_save(style); +- if (isradio) { +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO); +- } else { +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK); ++ widget = &gCheckbox; + } +- gtk_widget_set_direction(widget, direction); ++ gtk_style_context_save(widget->check.styleLabel); ++ gtk_widget_set_direction(widget->widget, direction); + +- gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state)); +- gtk_render_focus(style, cr, ++ gtk_style_context_set_state(widget->check.styleLabel, ++ GetStateFlagsFromGtkWidgetState(state)); ++ gtk_render_focus(widget->check.styleLabel, cr, + rect->x, rect->y, rect->width, rect->height); +- gtk_style_context_restore(style); ++ gtk_style_context_restore(widget->check.styleLabel); + + return MOZ_GTK_SUCCESS; + } +@@ -1917,7 +2093,7 @@ moz_gtk_toolbar_separator_paint(cairo_t + rect->height * (end_fraction - start_fraction)); + } else { + GtkBorder padding; +- gtk_style_context_get_padding(style, 0, &padding); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + + paint_width = padding.left; + if (paint_width > rect->width) +@@ -2004,18 +2180,13 @@ static gint + moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect, + GtkTextDirection direction) + { +- GtkStyleContext* style; +- + ensure_progress_widget(); +- gtk_widget_set_direction(gProgressWidget, direction); ++ gtk_widget_set_direction(gProgressBar.widget, direction); + +- style = gtk_widget_get_style_context(gProgressWidget); +- gtk_style_context_save(style); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); +- +- gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); +- gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); +- gtk_style_context_restore(style); ++ gtk_render_background(gProgressBar.progress.styleTrough, cr, ++ rect->x, rect->y, rect->width, rect->height); ++ gtk_render_frame(gProgressBar.progress.styleTrough, cr, ++ rect->x, rect->y, rect->width, rect->height); + + return MOZ_GTK_SUCCESS; + } +@@ -2025,15 +2196,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr + GtkTextDirection direction, + GtkThemeWidgetType widget) + { +- GtkStyleContext* style; +- + ensure_progress_widget(); +- gtk_widget_set_direction(gProgressWidget, direction); +- +- style = gtk_widget_get_style_context(gProgressWidget); +- gtk_style_context_save(style); +- gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR); ++ gtk_widget_set_direction(gProgressBar.widget, direction); + + if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE || + widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) { +@@ -2072,12 +2236,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr + // gtk_render_activity was used to render progress chunks on GTK versions + // before 3.13.7, see bug 1173907. + if (!gtk_check_version(3, 13, 7)) { +- gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); +- gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); ++ gtk_render_background(gProgressBar.progress.styleProgress, cr, ++ rect->x, rect->y, rect->width, rect->height); ++ gtk_render_frame(gProgressBar.progress.styleProgress, cr, ++ rect->x, rect->y, rect->width, rect->height); + } else { +- gtk_render_activity(style, cr, rect->x, rect->y, rect->width, rect->height); ++ gtk_render_activity(gProgressBar.progress.styleProgress, cr, ++ rect->x, rect->y, rect->width, rect->height); + } +- gtk_style_context_restore(style); + + return MOZ_GTK_SUCCESS; + } +@@ -2094,7 +2260,7 @@ moz_gtk_get_tab_thickness(void) + + style = gtk_widget_get_style_context(gTabWidget); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK); +- gtk_style_context_get_border(style, 0, &border); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); + + if (border.top < 2) + return 2; /* some themes don't set ythickness correctly */ +@@ -2290,7 +2456,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan + gtk_style_context_save(style); + moz_gtk_tab_prepare_style_context(style, flags); + +- gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); ++ moz_gtk_get_style_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); + + focusRect.x += padding.left; + focusRect.width -= (padding.left + padding.right); +@@ -2406,7 +2572,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * + } + + static gint +-moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, ++moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state, + GtkTextDirection direction) + { + GtkStyleContext* style; +@@ -2467,7 +2633,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr + border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); + + style = gtk_widget_get_style_context(gMenuSeparatorWidget); +- gtk_style_context_get_padding(style, 0, &padding); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + + x = rect->x + border_width; + y = rect->y + border_width; +@@ -2521,7 +2687,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk + item_widget = gMenuItemWidget; + } + style = gtk_widget_get_style_context(item_widget); +- gtk_style_context_save(style); ++// TODO - FIX! ++// gtk_style_context_save(style); + + if (flags & MOZ_TOPLEVEL_MENU_ITEM) { + gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR); +@@ -2540,7 +2707,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk + + gtk_render_background(style, cr, x, y, w, h); + gtk_render_frame(style, cr, x, y, w, h); +- gtk_style_context_restore(style); ++// gtk_style_context_restore(style); + } + + return MOZ_GTK_SUCCESS; +@@ -2556,7 +2723,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd + + ensure_menu_item_widget(); + gtk_widget_set_direction(gMenuItemWidget, direction); +- ++/* ++ state_flags |= (direction == GTK_TEXT_DIR_LTR) ? GTK_STATE_FLAG_DIR_LTR : ++ GTK_STATE_FLAG_DIR_RTL; ++*/ + style = gtk_widget_get_style_context(gMenuItemWidget); + gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM); +@@ -2606,7 +2776,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c + } + + gtk_style_context_set_state(style, state_flags); +- gtk_style_context_get_padding(style, state_flags, &padding); ++ moz_gtk_get_style_padding(style, state_flags, &padding); + + offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) + + padding.left + 2; +@@ -2658,7 +2828,7 @@ moz_gtk_add_style_border(GtkStyleContext + { + GtkBorder border; + +- gtk_style_context_get_border(style, 0, &border); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); + + *left += border.left; + *right += border.right; +@@ -2667,12 +2837,22 @@ moz_gtk_add_style_border(GtkStyleContext + } + + static void ++moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags, ++ GtkBorder *border) ++{ ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, state_flags); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), border); ++ gtk_style_context_restore(style); ++} ++ ++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); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + + *left += padding.left; + *right += padding.right; +@@ -2680,6 +2860,16 @@ moz_gtk_add_style_padding(GtkStyleContex + *bottom += padding.bottom; + } + ++static void ++moz_gtk_get_style_padding(GtkStyleContext* style, GtkStateFlags state_flags, ++ GtkBorder *padding) ++{ ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, state_flags); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), padding); ++ gtk_style_context_restore(style); ++} ++ + gint + moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top, + gint* right, gint* bottom, GtkTextDirection direction, +@@ -2694,36 +2884,27 @@ moz_gtk_get_widget_border(GtkThemeWidget + case MOZ_GTK_TOOLBAR_BUTTON: + { + ensure_button_widget(); +- style = gtk_widget_get_style_context(gButtonWidget); + +- *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget)); +- +- if (widget == MOZ_GTK_TOOLBAR_BUTTON) { +- gtk_style_context_save(style); +- gtk_style_context_add_class(style, "image-button"); +- } +- +- moz_gtk_add_style_padding(style, left, top, right, bottom); +- +- if (widget == MOZ_GTK_TOOLBAR_BUTTON) +- gtk_style_context_restore(style); ++ *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButton.widget)); ++ moz_gtk_add_style_padding(gButton.button.style, left, top, right, bottom); + + // XXX: Subtract 1 pixel from the border to account for the added + // -moz-focus-inner border (Bug 1228281). + *left -= 1; *top -= 1; *right -= 1; *bottom -= 1; +- moz_gtk_add_style_border(style, left, top, right, bottom); ++ moz_gtk_add_style_border(gButton.button.style, left, top, right, bottom); ++ + return MOZ_GTK_SUCCESS; + } + case MOZ_GTK_ENTRY: + { + ensure_entry_widget(); +- style = gtk_widget_get_style_context(gEntryWidget); + + // XXX: Subtract 1 pixel from the padding to account for the default + // padding in forms.css. See bug 1187385. + *left = *top = *right = *bottom = -1; +- moz_gtk_add_style_padding(style, left, top, right, bottom); +- moz_gtk_add_style_border(style, left, top, right, bottom); ++ ++ moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom); ++ moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom); + + return MOZ_GTK_SUCCESS; + } +@@ -2759,7 +2940,7 @@ moz_gtk_get_widget_border(GtkThemeWidget + break; + case MOZ_GTK_DROPDOWN_ENTRY: + ensure_combo_box_entry_widgets(); +- w = gComboBoxEntryTextareaWidget; ++ w = gComboBoxEntryTextarea.widget; + break; + case MOZ_GTK_DROPDOWN_ARROW: + ensure_combo_box_entry_widgets(); +@@ -2795,7 +2976,7 @@ moz_gtk_get_widget_border(GtkThemeWidget + + if (!wide_separators) { + style = gtk_widget_get_style_context(gComboBoxSeparatorWidget); +- gtk_style_context_get_border(style, 0, &border); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); + separator_width = border.left; + } + } +@@ -2814,14 +2995,17 @@ moz_gtk_get_widget_border(GtkThemeWidget + w = gTabWidget; + break; + case MOZ_GTK_PROGRESSBAR: +- ensure_progress_widget(); +- w = gProgressWidget; +- break; ++ { ++ ensure_progress_widget(); ++ moz_gtk_add_style_border(gProgressBar.progress.styleTrough, ++ left, top, right, bottom); ++ return MOZ_GTK_SUCCESS; ++ } + case MOZ_GTK_SPINBUTTON_ENTRY: + case MOZ_GTK_SPINBUTTON_UP: + case MOZ_GTK_SPINBUTTON_DOWN: + ensure_spin_widget(); +- w = gSpinWidget; ++ w = gSpin.widget; + break; + case MOZ_GTK_SCALE_HORIZONTAL: + ensure_scale_widget(); +@@ -2840,12 +3024,13 @@ moz_gtk_get_widget_border(GtkThemeWidget + { + if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) { + ensure_checkbox_widget(); +- w = gCheckboxWidget; ++ w = gCheckbox.widget; ++ style = gCheckbox.check.styleCheck; + } else { + ensure_radiobutton_widget(); +- w = gRadiobuttonWidget; ++ w = gRadiobutton.widget; ++ style = gRadiobutton.check.styleCheck; + } +- style = gtk_widget_get_style_context(w); + + *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w)); + moz_gtk_add_style_border(style, +@@ -2978,6 +3163,32 @@ moz_gtk_get_combo_box_entry_button_size( + } + + gint ++moz_gtk_get_entry_height(gint* height) ++{ ++ GtkRequisition requisition; ++ ensure_entry_widget(); ++ ++ gtk_widget_get_preferred_size(gEntry.widget, NULL, &requisition); ++ *height = requisition.height; ++ ++ return MOZ_GTK_SUCCESS; ++} ++ ++ ++gint ++moz_gtk_get_button_height(gint* height) ++{ ++ GtkRequisition requisition; ++ ensure_entry_widget(); ++ ++ gtk_widget_get_preferred_size(gButton.widget, NULL, &requisition); ++ *height = requisition.height; ++ ++ return MOZ_GTK_SUCCESS; ++} ++ ++ ++gint + moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height) + { + gint arrow_size; +@@ -3022,7 +3233,7 @@ moz_gtk_get_toolbar_separator_width(gint + "separator-width", &separator_width, + NULL); + /* Just in case... */ +- gtk_style_context_get_border(style, 0, &border); ++ gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); + *size = MAX(*size, (wide_separators ? separator_width : border.left)); + return MOZ_GTK_SUCCESS; + } +@@ -3064,7 +3275,7 @@ moz_gtk_get_menu_separator_height(gint * + border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); + + style = gtk_widget_get_style_context(gMenuSeparatorWidget); +- gtk_style_context_get_padding(style, 0, &padding); ++ gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); + + gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR); +@@ -3122,15 +3333,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro + { + ensure_scrollbar_widget(); + +- gtk_widget_style_get (gHorizScrollbarWidget, ++ gtk_widget_style_get (gHorizScrollbar.widget, + "slider_width", &metrics->slider_width, + "trough_border", &metrics->trough_border, + "stepper_size", &metrics->stepper_size, + "stepper_spacing", &metrics->stepper_spacing, + NULL); + +- metrics->min_slider_size = +- gtk_range_get_min_slider_size(GTK_RANGE(gHorizScrollbarWidget)); ++ if (!gtk_check_version(3,19,7)) { ++ gtk_style_context_get(gVertScrollbar.scroll.styleSlider, ++ gtk_style_context_get_state(gVertScrollbar.scroll.styleSlider), ++ "min-height", &metrics->min_slider_size, NULL); ++ } else { ++ metrics->min_slider_size = ++ gtk_range_get_min_slider_size(GTK_RANGE(gVertScrollbar.widget)); ++ } + + return MOZ_GTK_SUCCESS; + } +@@ -3155,7 +3372,7 @@ moz_gtk_images_in_buttons() + GtkSettings* settings; + + ensure_button_widget(); +- settings = gtk_widget_get_settings(gButtonWidget); ++ settings = gtk_widget_get_settings(gButton.widget); + + g_object_get(settings, "gtk-button-images", &result, NULL); + return result; +@@ -3183,7 +3400,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType + } + ensure_button_widget(); + return moz_gtk_button_paint(cr, rect, state, +- (GtkReliefStyle) flags, gButtonWidget, ++ (GtkReliefStyle) flags, gButton.widget, + direction); + break; + case MOZ_GTK_CHECKBUTTON: +@@ -3233,7 +3450,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType + case MOZ_GTK_SPINBUTTON_ENTRY: + ensure_spin_widget(); + return moz_gtk_entry_paint(cr, rect, state, +- gSpinWidget, direction); ++ &gSpin, direction); + break; + case MOZ_GTK_GRIPPER: + return moz_gtk_gripper_paint(cr, rect, state, +@@ -3260,7 +3477,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType + case MOZ_GTK_ENTRY: + ensure_entry_widget(); + return moz_gtk_entry_paint(cr, rect, state, +- gEntryWidget, direction); ++ &gEntry, direction); + break; + case MOZ_GTK_DROPDOWN: + return moz_gtk_combo_box_paint(cr, rect, state, direction); +@@ -3272,7 +3489,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType + case MOZ_GTK_DROPDOWN_ENTRY: + ensure_combo_box_entry_widgets(); + return moz_gtk_entry_paint(cr, rect, state, +- gComboBoxEntryTextareaWidget, direction); ++ &gComboBoxEntryTextarea, direction); + break; + case MOZ_GTK_CHECKBUTTON_CONTAINER: + case MOZ_GTK_RADIOBUTTON_CONTAINER: +@@ -3324,7 +3541,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType + (GtkArrowType) flags, direction); + break; + case MOZ_GTK_MENUBAR: +- return moz_gtk_menu_bar_paint(cr, rect, direction); ++ return moz_gtk_menu_bar_paint(cr, rect, state, direction); + break; + case MOZ_GTK_MENUPOPUP: + return moz_gtk_menu_popup_paint(cr, rect, direction); +@@ -3375,7 +3592,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( + { + MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); + ensure_scrollbar_widget(); +- return gHorizScrollbarWidget; ++ return gVertScrollbar.widget; + } + + gboolean moz_gtk_has_scrollbar_buttons(void) +@@ -3383,7 +3600,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v + gboolean backward, forward, secondary_backward, secondary_forward; + MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); + ensure_scrollbar_widget(); +- gtk_widget_style_get (gHorizScrollbarWidget, ++ gtk_widget_style_get (gHorizScrollbar.widget, + "has-backward-stepper", &backward, + "has-forward-stepper", &forward, + "has-secondary-backward-stepper", &secondary_backward, +@@ -3409,17 +3626,19 @@ moz_gtk_shutdown() + + gProtoWindow = NULL; + gProtoLayout = NULL; +- gButtonWidget = NULL; ++ ++ // MozWidgets ++ moz_gtk_widget_free(&gButton); + gToggleButtonWidget = NULL; + gButtonArrowWidget = NULL; +- gCheckboxWidget = NULL; +- gRadiobuttonWidget = NULL; +- gHorizScrollbarWidget = NULL; +- gVertScrollbarWidget = NULL; +- gSpinWidget = NULL; ++ moz_gtk_widget_free(&gCheckbox); ++ moz_gtk_widget_free(&gRadiobutton); ++ moz_gtk_widget_free(&gHorizScrollbar); ++ moz_gtk_widget_free(&gVertScrollbar); ++ moz_gtk_widget_free(&gSpin); + gHScaleWidget = NULL; + gVScaleWidget = NULL; +- gEntryWidget = NULL; ++ moz_gtk_widget_free(&gEntry); + gComboBoxWidget = NULL; + gComboBoxButtonWidget = NULL; + gComboBoxSeparatorWidget = NULL; +@@ -3427,12 +3646,12 @@ moz_gtk_shutdown() + gComboBoxEntryWidget = NULL; + gComboBoxEntryButtonWidget = NULL; + gComboBoxEntryArrowWidget = NULL; +- gComboBoxEntryTextareaWidget = NULL; ++ moz_gtk_widget_free(&gComboBoxEntryTextarea); + gHandleBoxWidget = NULL; + gToolbarWidget = NULL; + gStatusbarWidget = NULL; + gFrameWidget = NULL; +- gProgressWidget = NULL; ++ moz_gtk_widget_free(&gProgressBar); + gTabWidget = NULL; + gTooltipWidget = NULL; + gMenuBarWidget = NULL; +diff -up firefox-45.0.1/widget/gtk/gtkdrawing.h.gtk3-20 firefox-45.0.1/widget/gtk/gtkdrawing.h +--- firefox-45.0.1/widget/gtk/gtkdrawing.h.gtk3-20 2016-03-15 23:37:46.000000000 +0100 ++++ firefox-45.0.1/widget/gtk/gtkdrawing.h 2016-04-05 14:40:27.847088629 +0200 +@@ -67,6 +67,13 @@ typedef enum { + MOZ_GTK_TAB_SELECTED = 1 << 10 + } GtkTabFlags; + ++typedef struct { ++ GType type; ++ const gchar *name; ++ const gchar *class1; ++ const gchar *class2; ++} GtkCssNode; ++ + /** flags for menuitems **/ + typedef enum { + /* menuitem is part of the menubar */ +@@ -394,6 +401,10 @@ gint moz_gtk_get_tab_scroll_arrow_size(g + */ + gint moz_gtk_get_arrow_size(gint* width, gint* height); + ++gint moz_gtk_get_entry_height(gint* height); ++ ++gint moz_gtk_get_button_height(gint* height); ++ + /** + * Get the desired size of a toolbar separator + * size: [OUT] the desired width +@@ -464,6 +475,12 @@ gboolean moz_gtk_images_in_buttons(void) + */ + gboolean moz_gtk_has_scrollbar_buttons(void); + ++ ++GtkStyleContext * ++moz_gtk_style_create(GtkCssNode *node, GtkStyleContext *parent); ++ ++ ++ + #ifdef __cplusplus + } + #endif /* __cplusplus */ +diff -up firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c +--- firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 2016-04-05 14:40:27.799088451 +0200 ++++ firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c 2016-04-05 15:16:17.401430826 +0200 +@@ -503,6 +503,11 @@ STUB(gtk_window_set_type_hint) + STUB(gtk_window_set_wmclass) + STUB(gtk_window_unfullscreen) + STUB(gtk_window_unmaximize) ++STUB(gtk_widget_get_preferred_height_and_baseline_for_width) ++STUB(gtk_entry_get_text_area) ++STUB(gtk_check_menu_item_get_type) ++STUB(gtk_spin_button_get_type) ++STUB(gtk_button_get_type) + #endif + + #ifdef GTK3_SYMBOLS +@@ -550,6 +555,7 @@ STUB(gtk_style_context_get_border_color) + STUB(gtk_style_context_get_color) + STUB(gtk_style_context_get_margin) + STUB(gtk_style_context_get_padding) ++STUB(gtk_style_context_get_state) + STUB(gtk_style_context_has_class) + STUB(gtk_style_context_new) + STUB(gtk_style_context_remove_class) +@@ -577,6 +583,13 @@ STUB(gtk_color_chooser_get_type) + STUB(gtk_color_chooser_set_rgba) + STUB(gtk_color_chooser_get_rgba) + STUB(gtk_color_chooser_set_use_alpha) ++STUB(gtk_style_context_get_path) ++STUB(gtk_widget_path_copy) ++STUB(gtk_widget_path_iter_set_object_name) ++STUB(gtk_widget_path_iter_add_class) ++STUB(gtk_widget_path_iter_get_state) ++STUB(gtk_style_context_set_parent) ++STUB(gtk_widget_path_unref) + #endif + + #ifdef GTK2_SYMBOLS +diff -up firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp +--- firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-03-15 23:37:46.000000000 +0100 ++++ firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp 2016-04-05 14:40:27.848088632 +0200 +@@ -232,14 +232,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI + case eColorID_activeborder: + // active window border + gtk_style_context_get_border_color(mBackgroundStyle, +- GTK_STATE_FLAG_NORMAL, &gdk_color); ++ gtk_style_context_get_state(mBackgroundStyle), ++ &gdk_color); + aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); + break; + case eColorID_inactiveborder: + // inactive window border ++ gtk_style_context_save(mBackgroundStyle); ++ gtk_style_context_set_state(mBackgroundStyle, GTK_STATE_FLAG_INSENSITIVE); + gtk_style_context_get_border_color(mBackgroundStyle, +- GTK_STATE_FLAG_INSENSITIVE, ++ gtk_style_context_get_state(mBackgroundStyle), + &gdk_color); ++ gtk_style_context_restore(mBackgroundStyle); + aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); + break; + case eColorID_graytext: // disabled text in windows, menus, etc. +@@ -248,9 +252,12 @@ nsLookAndFeel::NativeGetColor(ColorID aI + break; + case eColorID_inactivecaption: + // inactive window caption ++ gtk_style_context_save(mBackgroundStyle); ++ gtk_style_context_set_state(mBackgroundStyle, GTK_STATE_FLAG_INSENSITIVE); + gtk_style_context_get_background_color(mBackgroundStyle, +- GTK_STATE_FLAG_INSENSITIVE, ++ gtk_style_context_get_state(mBackgroundStyle), + &gdk_color); ++ gtk_style_context_restore(mBackgroundStyle); + aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); + break; + #endif +@@ -376,13 +383,17 @@ nsLookAndFeel::NativeGetColor(ColorID aI + case eColorID__moz_buttondefault: + // default button border color + gtk_style_context_get_border_color(mButtonStyle, +- GTK_STATE_FLAG_NORMAL, &gdk_color); ++ gtk_style_context_get_state(mButtonStyle), ++ &gdk_color); + aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); + break; + case eColorID__moz_buttonhoverface: ++ gtk_style_context_save(mButtonStyle); ++ gtk_style_context_set_state(mButtonStyle, GTK_STATE_FLAG_PRELIGHT); + gtk_style_context_get_background_color(mButtonStyle, +- GTK_STATE_FLAG_PRELIGHT, ++ gtk_style_context_get_state(mButtonStyle), + &gdk_color); ++ gtk_style_context_restore(mButtonStyle); + aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); + break; + case eColorID__moz_buttonhovertext: +@@ -989,7 +1000,7 @@ nsLookAndFeel::Init() + style = create_context(path); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_SCROLLBAR); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sMozScrollbar = GDK_RGBA_TO_NS_RGBA(color); + g_object_unref(style); + +@@ -997,18 +1008,18 @@ nsLookAndFeel::Init() + style = create_context(path); + gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sMozWindowBackground = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMozWindowText = GDK_RGBA_TO_NS_RGBA(color); + gtk_style_context_restore(style); + + // tooltip foreground and background + gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sInfoBackground = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sInfoText = GDK_RGBA_TO_NS_RGBA(color); + g_object_unref(style); + +@@ -1023,20 +1034,26 @@ nsLookAndFeel::Init() + gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); + + style = gtk_widget_get_style_context(accel_label); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMenuText = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_INSENSITIVE, &color); ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, GTK_STATE_FLAG_INSENSITIVE); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMenuTextInactive = GDK_RGBA_TO_NS_RGBA(color); ++ gtk_style_context_restore(style); + + style = gtk_widget_get_style_context(menu); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sMenuBackground = GDK_RGBA_TO_NS_RGBA(color); + + style = gtk_widget_get_style_context(menuitem); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_PRELIGHT, &color); ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, GTK_STATE_FLAG_PRELIGHT); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sMenuHover = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_PRELIGHT, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMenuHoverText = GDK_RGBA_TO_NS_RGBA(color); ++ gtk_style_context_restore(style); + + g_object_unref(menu); + #endif +@@ -1145,44 +1162,54 @@ nsLookAndFeel::Init() + GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]); + } + #else ++ GtkCssNode labelPath[] = { ++ { GTK_TYPE_LABEL, "label", "view", NULL }, ++ { G_TYPE_NONE, "selection", NULL, NULL } ++ }; ++ ++ GtkStyleContext *styleLabel; ++ GtkStyleContext *styleSelection; ++ GtkBorder padding; ++ + // Text colors +- style = gtk_widget_get_style_context(textView); +- gtk_style_context_save(style); +- gtk_style_context_add_class(style, GTK_STYLE_CLASS_VIEW); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ styleLabel = moz_gtk_style_create(labelPath, NULL); ++ styleSelection = moz_gtk_style_create(labelPath+1, styleLabel); ++ ++ gtk_style_context_get_background_color(styleLabel, gtk_style_context_get_state(styleLabel), &color); + sMozFieldBackground = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(styleLabel, gtk_style_context_get_state(styleLabel), &color); + sMozFieldText = GDK_RGBA_TO_NS_RGBA(color); + + // Selected text and background +- gtk_style_context_get_background_color(style, +- static_cast(GTK_STATE_FLAG_FOCUSED|GTK_STATE_FLAG_SELECTED), +- &color); ++ gtk_style_context_get_background_color(styleSelection, gtk_style_context_get_state(styleSelection), &color); + sTextSelectedBackground = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, +- static_cast(GTK_STATE_FLAG_FOCUSED|GTK_STATE_FLAG_SELECTED), +- &color); ++ gtk_style_context_get_color(styleSelection, gtk_style_context_get_state(styleSelection), &color); + sTextSelectedText = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_restore(style); + + // Button text, background, border + style = gtk_widget_get_style_context(label); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sButtonText = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_PRELIGHT, &color); ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, GTK_STATE_FLAG_PRELIGHT); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sButtonHoverText = GDK_RGBA_TO_NS_RGBA(color); ++ gtk_style_context_restore(style); + + // Combobox text color + style = gtk_widget_get_style_context(comboboxLabel); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sComboBoxText = GDK_RGBA_TO_NS_RGBA(color); + + // Menubar text and hover text colors + style = gtk_widget_get_style_context(menuBar); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMenuBarText = GDK_RGBA_TO_NS_RGBA(color); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_PRELIGHT, &color); ++ gtk_style_context_save(style); ++ gtk_style_context_set_state(style, GTK_STATE_FLAG_PRELIGHT); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sMenuBarHoverText = GDK_RGBA_TO_NS_RGBA(color); ++ gtk_style_context_restore(style); + + // GTK's guide to fancy odd row background colors: + // 1) Check if a theme explicitly defines an odd row color +@@ -1195,7 +1222,7 @@ nsLookAndFeel::Init() + // Get odd row background color + gtk_style_context_save(style); + gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD); +- gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); + sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color); + gtk_style_context_restore(style); + +@@ -1205,7 +1232,7 @@ nsLookAndFeel::Init() + // TODO GTK3 - update sFrameOuterLightBorder + // for GTK_BORDER_STYLE_INSET/OUTSET/GROVE/RIDGE border styles (Bug 978172). + style = gtk_widget_get_style_context(frame); +- gtk_style_context_get_border_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_border_color(style, gtk_style_context_get_state(style), &color); + sFrameInnerDarkBorder = sFrameOuterLightBorder = GDK_RGBA_TO_NS_RGBA(color); + + gtk_widget_path_free(path); +@@ -1217,9 +1244,11 @@ nsLookAndFeel::Init() + gtk_container_add(GTK_CONTAINER(parent), infoBar); + gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel); + style = gtk_widget_get_style_context(infoBarLabel); ++ gtk_style_context_save(style); + gtk_style_context_add_class(style, GTK_STYLE_CLASS_INFO); +- gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); ++ gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); + sInfoBarText = GDK_RGBA_TO_NS_RGBA(color); ++ gtk_style_context_restore(style); + #endif + // Some themes have a unified menu bar, and support window dragging on it + gboolean supports_menubar_drag = FALSE; +diff -up firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp +--- firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 2016-03-15 23:37:46.000000000 +0100 ++++ firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp 2016-04-05 14:40:27.848088632 +0200 +@@ -1548,9 +1548,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n + case NS_THEME_RADIO_CONTAINER: + case NS_THEME_CHECKBOX_LABEL: + case NS_THEME_RADIO_LABEL: +- case NS_THEME_BUTTON: +- case NS_THEME_DROPDOWN: +- case NS_THEME_TOOLBAR_BUTTON: + case NS_THEME_TREEVIEW_HEADER_CELL: + { + // Just include our border, and let the box code augment the size. +@@ -1560,6 +1557,21 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n + aResult->width = border.left + border.right; + aResult->height = border.top + border.bottom; + } ++ break; ++ case NS_THEME_BUTTON: ++ case NS_THEME_DROPDOWN: ++ case NS_THEME_TOOLBAR_BUTTON: ++ { ++ moz_gtk_get_button_height(&aResult->height); ++ } ++ break; ++ case NS_THEME_FOCUS_OUTLINE: ++ case NS_THEME_NUMBER_INPUT: ++ case NS_THEME_TEXTFIELD: ++ case NS_THEME_TEXTFIELD_MULTILINE: ++ { ++ moz_gtk_get_entry_height(&aResult->height); ++ } + break; + case NS_THEME_TOOLBAR_SEPARATOR: + { + From 946a2cf79c29430d46da6d1b56debc638acbe17de4c844e98f216a922c0f4e93 Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Thu, 14 Apr 2016 10:14:02 +0000 Subject: [PATCH 02/12] Accepting request 389750 from devel:ARM:Factory - build fixes for arm/aarch64: * disable webrtc for arm/aarch64 * switch away from openGL-ES backend to default for arm/aarch64 since it almost never builds * reenable neon - reenable webrtc for powerpc as it seems to build OBS-URL: https://build.opensuse.org/request/show/389750 OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=497 --- MozillaFirefox.changes | 10 ++++++++++ MozillaFirefox.spec | 12 +++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index f318ba3..d751009 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -134,6 +134,16 @@ Thu Feb 11 07:51:34 UTC 2016 - wr@rosenauer.org * Fix a crash in cache networking (bmo#1244076) * Fix using WebSockets in service worker controlled pages (bmo#1243942) +------------------------------------------------------------------- +Sat Jan 30 08:28:17 UTC 2016 - dmueller@suse.com + +- build fixes for arm/aarch64: + * disable webrtc for arm/aarch64 + * switch away from openGL-ES backend to default for arm/aarch64 + since it almost never builds + * reenable neon +- reenable webrtc for powerpc as it seems to build + ------------------------------------------------------------------- Sun Jan 24 09:33:15 UTC 2016 - wr@rosenauer.org diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 9b27861..14570d3 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -368,17 +368,15 @@ ac_add_options --enable-libproxy %if ! %crashreporter ac_add_options --disable-crashreporter %endif -# Disable neon for arm as it does not build correctly %ifarch %arm -ac_add_options --disable-neon +ac_add_options --disable-elf-hack +ac_add_options --with-fpu=vfpv3-d16 +ac_add_options --with-float-abi=hard +ac_add_options --with-arch=armv7-a %endif -%ifnarch %ix86 x86_64 +%ifarch %arm aarch64 s390x ac_add_options --disable-webrtc %endif -# try to use OpenGL-ES on ARM -%ifarch %arm aarch64 -ac_add_options --with-gl-provider=EGL -%endif EOF make -f client.mk build From e165f239a4c8425b983872afe94a8e60d9909fdc8a8e03a8ac03dfa02322611d Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Sun, 24 Apr 2016 06:17:46 +0000 Subject: [PATCH 03/12] Accepting request 391154 from home:badshah400:branches:mozilla:Factory mozilla-gtk3_20.patch synced to latest fedora's to fix some scrollbar issues when using gtk 3.20 OBS-URL: https://build.opensuse.org/request/show/391154 OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=499 --- MozillaFirefox.changes | 6 ++ mozilla-gtk3_20.patch | 228 +++++++++++++++++++++-------------------- 2 files changed, 124 insertions(+), 110 deletions(-) diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index d751009..541714a 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 21 12:00:28 UTC 2016 - badshah400@gmail.com + +- Update mozilla-gtk3_20.patch to fix scrollbar appearance under + gtk >= 3.20 (patch synced to Fedora's version). + ------------------------------------------------------------------- Tue Apr 12 19:11:30 UTC 2016 - badshah400@gmail.com diff --git a/mozilla-gtk3_20.patch b/mozilla-gtk3_20.patch index 63da60c..a9e4e32 100644 --- a/mozilla-gtk3_20.patch +++ b/mozilla-gtk3_20.patch @@ -1,7 +1,7 @@ -diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/gtk/gtk3drawing.c ---- firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 2016-03-15 23:37:46.000000000 +0100 -+++ firefox-45.0.1/widget/gtk/gtk3drawing.c 2016-04-05 14:40:27.846088625 +0200 -@@ -17,32 +17,78 @@ +diff -up firefox-45.0.2/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.2/widget/gtk/gtk3drawing.c +--- firefox-45.0.2/widget/gtk/gtk3drawing.c.gtk3-20 2016-04-08 01:55:04.000000000 +0200 ++++ firefox-45.0.2/widget/gtk/gtk3drawing.c 2016-04-20 18:49:52.897795872 +0200 +@@ -17,32 +17,79 @@ #include @@ -22,6 +22,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g + + struct { + GtkStyleContext* style; ++ GtkStyleContext* styleContents; + GtkStyleContext* styleTrough; + GtkStyleContext* styleSlider; + } scroll; @@ -89,7 +90,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g static GtkWidget* gTabWidget; static GtkWidget* gTooltipWidget; static GtkWidget* gMenuBarWidget; -@@ -78,6 +124,37 @@ static gboolean is_initialized; +@@ -78,6 +125,37 @@ static gboolean is_initialized; #define GTK_STATE_FLAG_CHECKED (1 << 11) #endif @@ -127,7 +128,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g static GtkStateFlags GetStateFlagsFromGtkWidgetState(GtkWidgetState* state) { -@@ -97,6 +174,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge +@@ -97,6 +175,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge return stateFlags; } @@ -169,7 +170,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g /* Because we have such an unconventional way of drawing widgets, signal to the GTK theme engine that they are drawing for Mozilla instead of a conventional GTK app so they can do any specific things they may want to do. */ -@@ -141,9 +253,16 @@ setup_widget_prototype(GtkWidget* widget +@@ -141,9 +254,16 @@ setup_widget_prototype(GtkWidget* widget static gint ensure_button_widget() { @@ -189,7 +190,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; } -@@ -195,9 +314,21 @@ ensure_button_arrow_widget() +@@ -195,9 +315,21 @@ ensure_button_arrow_widget() static gint ensure_checkbox_widget() { @@ -214,7 +215,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; } -@@ -205,9 +336,21 @@ ensure_checkbox_widget() +@@ -205,9 +337,21 @@ ensure_checkbox_widget() static gint ensure_radiobutton_widget() { @@ -239,7 +240,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; } -@@ -215,13 +358,31 @@ ensure_radiobutton_widget() +@@ -215,25 +359,62 @@ ensure_radiobutton_widget() static gint ensure_scrollbar_widget() { @@ -250,35 +251,42 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g - if (!gHorizScrollbarWidget) { - gHorizScrollbarWidget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL); - setup_widget_prototype(gHorizScrollbarWidget); +- } + if (!gVertScrollbar.widget && !gHorizScrollbar.widget) { + GtkCssNode path[] = { -+ { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", NULL }, -+ { GTK_TYPE_SCROLLBAR, "scrollbar", "vertical", NULL }, -+ { GTK_TYPE_SCROLLBAR, "trough", NULL, NULL }, -+ { GTK_TYPE_SCROLLBAR, "slider", NULL, NULL } ++ { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", "bottom"}, ++ { GTK_TYPE_SCROLLBAR, "scrollbar", "vertical", "right" }, ++ { G_TYPE_NONE, "contents", NULL, NULL }, ++ { G_TYPE_NONE, "trough", NULL, NULL }, ++ { G_TYPE_NONE, "slider", NULL, NULL } + }; + -+ gVertScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL); -+ setup_widget_prototype(gVertScrollbar.widget); -+ -+ gVertScrollbar.scroll.style = moz_gtk_style_create(path+1, NULL); -+ gVertScrollbar.scroll.styleTrough = moz_gtk_style_create(path+2, -+ gVertScrollbar.scroll.style); -+ gVertScrollbar.scroll.styleSlider = moz_gtk_style_create(path+3, -+ gVertScrollbar.scroll.styleTrough); -+ + gHorizScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL); + setup_widget_prototype(gHorizScrollbar.widget); + + gHorizScrollbar.scroll.style = moz_gtk_style_create(path, NULL); -+ gHorizScrollbar.scroll.styleTrough = moz_gtk_style_create(path+2, ++ gHorizScrollbar.scroll.styleContents = moz_gtk_style_create(path+2, + gHorizScrollbar.scroll.style); -+ gHorizScrollbar.scroll.styleSlider = moz_gtk_style_create(path+3, ++ gHorizScrollbar.scroll.styleTrough = moz_gtk_style_create(path+3, ++ gHorizScrollbar.scroll.styleContents); ++ gHorizScrollbar.scroll.styleSlider = moz_gtk_style_create(path+4, + gHorizScrollbar.scroll.styleTrough); - } ++ ++ gVertScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL); ++ setup_widget_prototype(gVertScrollbar.widget); ++ ++ gVertScrollbar.scroll.style = moz_gtk_style_create(path+1, NULL); ++ gVertScrollbar.scroll.styleContents = moz_gtk_style_create(path+2, ++ gVertScrollbar.scroll.style); ++ gVertScrollbar.scroll.styleTrough = moz_gtk_style_create(path+3, ++ gVertScrollbar.scroll.styleContents); ++ gVertScrollbar.scroll.styleSlider = moz_gtk_style_create(path+4, ++ gVertScrollbar.scroll.styleTrough); ++ ++ } return MOZ_GTK_SUCCESS; } -@@ -229,11 +390,24 @@ ensure_scrollbar_widget() + static gint ensure_spin_widget() { @@ -308,7 +316,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } static gint -@@ -253,9 +427,19 @@ ensure_scale_widget() +@@ -253,9 +434,19 @@ ensure_scale_widget() static gint ensure_entry_widget() { @@ -331,7 +339,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; } -@@ -387,9 +571,9 @@ moz_gtk_get_combo_box_entry_inner_widget +@@ -387,9 +578,9 @@ moz_gtk_get_combo_box_entry_inner_widget g_object_add_weak_pointer(G_OBJECT(widget), (gpointer) &gComboBoxEntryButtonWidget); } else if (GTK_IS_ENTRY(widget)) { @@ -343,7 +351,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } else return; gtk_widget_realize(widget); -@@ -411,7 +595,7 @@ ensure_combo_box_entry_widgets() +@@ -411,7 +602,7 @@ ensure_combo_box_entry_widgets() { GtkWidget* buttonChild; @@ -352,7 +360,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gComboBoxEntryButtonWidget && gComboBoxEntryArrowWidget) return MOZ_GTK_SUCCESS; -@@ -427,9 +611,9 @@ ensure_combo_box_entry_widgets() +@@ -427,9 +618,9 @@ ensure_combo_box_entry_widgets() moz_gtk_get_combo_box_entry_inner_widgets, NULL); @@ -364,7 +372,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } if (gComboBoxEntryButtonWidget) { -@@ -528,9 +712,21 @@ ensure_tab_widget() +@@ -528,9 +719,21 @@ ensure_tab_widget() static gint ensure_progress_widget() { @@ -389,7 +397,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; } -@@ -636,6 +832,11 @@ static gint +@@ -636,6 +839,11 @@ static gint ensure_check_menu_item_widget() { if (!gCheckMenuItemWidget) { @@ -401,7 +409,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g ensure_menu_popup_widget(); gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), -@@ -757,7 +958,7 @@ moz_gtk_checkbox_get_metrics(gint* indic +@@ -757,7 +965,7 @@ moz_gtk_checkbox_get_metrics(gint* indic { ensure_checkbox_widget(); @@ -410,7 +418,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g "indicator_size", indicator_size, "indicator_spacing", indicator_spacing, NULL); -@@ -770,7 +971,7 @@ moz_gtk_radio_get_metrics(gint* indicato +@@ -770,7 +978,7 @@ moz_gtk_radio_get_metrics(gint* indicato { ensure_radiobutton_widget(); @@ -419,7 +427,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g "indicator_size", indicator_size, "indicator_spacing", indicator_spacing, NULL); -@@ -783,13 +984,12 @@ moz_gtk_get_focus_outline_size(gint* foc +@@ -783,13 +991,12 @@ moz_gtk_get_focus_outline_size(gint* foc { GtkBorder border; GtkBorder padding; @@ -436,7 +444,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g *focus_h_width = border.left + padding.left; *focus_v_width = border.top + padding.top; return MOZ_GTK_SUCCESS; -@@ -826,7 +1026,7 @@ moz_gtk_button_get_default_overflow(gint +@@ -826,7 +1033,7 @@ moz_gtk_button_get_default_overflow(gint GtkBorder* default_outside_border; ensure_button_widget(); @@ -445,7 +453,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g "default-outside-border", &default_outside_border, NULL); -@@ -849,7 +1049,7 @@ moz_gtk_button_get_default_border(gint* +@@ -849,7 +1056,7 @@ moz_gtk_button_get_default_border(gint* GtkBorder* default_border; ensure_button_widget(); @@ -454,7 +462,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g "default-border", &default_border, NULL); -@@ -940,7 +1140,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec +@@ -940,7 +1147,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec if (state->focused) { GtkBorder border; @@ -463,7 +471,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g x += border.left; y += border.top; width -= (border.left + border.right); -@@ -961,15 +1161,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec +@@ -961,15 +1168,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec gint indicator_size, indicator_spacing; gint x, y, width, height; gint focus_x, focus_y, focus_width, focus_height; @@ -482,7 +490,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } // XXX we should assert rect->height >= indicator_size too -@@ -988,11 +1187,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec +@@ -988,11 +1194,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec focus_width = width + 2 * indicator_spacing; focus_height = height + 2 * indicator_spacing; @@ -497,7 +505,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g if (selected) state_flags |= checkbox_check_state; -@@ -1000,13 +1197,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec +@@ -1000,13 +1204,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec if (inconsistent) state_flags |= GTK_STATE_FLAG_INCONSISTENT; @@ -517,7 +525,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g focus_width, focus_height); } } -@@ -1015,15 +1214,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec +@@ -1015,15 +1221,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec * 'indeterminate' type on checkboxes. In GTK, the shadow type * must also be changed for the state to be drawn. */ @@ -537,7 +545,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -1040,8 +1238,8 @@ calculate_button_inner_rect(GtkWidget* b +@@ -1040,8 +1245,8 @@ calculate_button_inner_rect(GtkWidget* b style = gtk_widget_get_style_context(button); /* This mirrors gtkbutton's child positioning */ @@ -548,7 +556,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g inner_rect->x = rect->x + border.left + padding.left; inner_rect->y = rect->y + padding.top + border.top; -@@ -1107,9 +1305,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * +@@ -1107,9 +1312,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * ensure_scrollbar_widget(); if (flags & MOZ_GTK_STEPPER_VERTICAL) @@ -560,7 +568,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_widget_set_direction(scrollbar, direction); -@@ -1175,26 +1373,23 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW +@@ -1175,26 +1380,23 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW GtkTextDirection direction) { GtkStyleContext* style; @@ -576,11 +584,11 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g - gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); + if (widget == MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL) { + gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction); -+ style = gHorizScrollbar.scroll.styleTrough; ++ style = gHorizScrollbar.scroll.style; + } + else { + gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction); -+ style = gVertScrollbar.scroll.styleTrough; ++ style = gVertScrollbar.scroll.style; + } if (flags & MOZ_GTK_TRACK_OPAQUE) { @@ -595,7 +603,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); -@@ -1202,7 +1397,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW +@@ -1202,7 +1404,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW gtk_render_focus(style, cr, rect->x, rect->y, rect->width, rect->height); } @@ -603,7 +611,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -1214,25 +1408,21 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi +@@ -1214,25 +1415,21 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi { GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); GtkStyleContext* style; @@ -637,7 +645,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_style_context_get_margin (style, state_flags, &margin); gtk_render_slider(style, cr, -@@ -1243,8 +1433,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi +@@ -1243,8 +1440,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); @@ -646,7 +654,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -1255,8 +1443,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta +@@ -1255,8 +1450,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta GtkStyleContext* style; ensure_spin_widget(); @@ -657,7 +665,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_style_context_save(style); gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); -@@ -1275,11 +1463,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G +@@ -1275,11 +1470,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G GtkStyleContext* style; ensure_spin_widget(); @@ -671,7 +679,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); -@@ -1445,15 +1632,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec +@@ -1445,15 +1639,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec static gint moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state, @@ -690,7 +698,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g if (draw_focus_outline_only) { // Inflate the given 'rect' with the focus outline size. -@@ -1473,10 +1658,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect +@@ -1473,10 +1665,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect * textarea window uses gtk_paint_flat_box when exposed */ /* This gets us a lovely greyish disabledish look */ @@ -702,7 +710,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g /* Now paint the shadow and focus border. * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad -@@ -1526,7 +1710,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR +@@ -1526,7 +1717,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR style = gtk_widget_get_style_context(gScrolledWindowWidget); gtk_style_context_save(style); gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME); @@ -711,7 +719,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g xthickness = border.left; ythickness = border.top; -@@ -1697,7 +1881,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk +@@ -1697,7 +1888,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk if (direction == GTK_TEXT_DIR_LTR) { GtkBorder padding; GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); @@ -720,7 +728,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g arrow_rect.x -= padding.left; } else -@@ -1799,29 +1983,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk +@@ -1799,29 +1990,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk gboolean isradio, GtkTextDirection direction) { GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); @@ -758,7 +766,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -1831,32 +2013,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr, +@@ -1831,32 +2020,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr, GtkWidgetState* state, gboolean isradio, GtkTextDirection direction) { @@ -776,15 +784,15 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } else { ensure_checkbox_widget(); - widget = gCheckboxWidget; -- } ++ widget = &gCheckbox; + } - style = gtk_widget_get_style_context(widget); - gtk_style_context_save(style); - if (isradio) { - gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO); - } else { - gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK); -+ widget = &gCheckbox; - } +- } - gtk_widget_set_direction(widget, direction); + gtk_style_context_save(widget->check.styleLabel); + gtk_widget_set_direction(widget->widget, direction); @@ -800,7 +808,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -1917,7 +2093,7 @@ moz_gtk_toolbar_separator_paint(cairo_t +@@ -1917,7 +2100,7 @@ moz_gtk_toolbar_separator_paint(cairo_t rect->height * (end_fraction - start_fraction)); } else { GtkBorder padding; @@ -809,7 +817,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g paint_width = padding.left; if (paint_width > rect->width) -@@ -2004,18 +2180,13 @@ static gint +@@ -2004,18 +2187,13 @@ static gint moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect, GtkTextDirection direction) { @@ -833,7 +841,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -2025,15 +2196,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr +@@ -2025,15 +2203,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr GtkTextDirection direction, GtkThemeWidgetType widget) { @@ -850,7 +858,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE || widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) { -@@ -2072,12 +2236,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr +@@ -2072,12 +2243,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr // gtk_render_activity was used to render progress chunks on GTK versions // before 3.13.7, see bug 1173907. if (!gtk_check_version(3, 13, 7)) { @@ -869,7 +877,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -2094,7 +2260,7 @@ moz_gtk_get_tab_thickness(void) +@@ -2094,7 +2267,7 @@ moz_gtk_get_tab_thickness(void) style = gtk_widget_get_style_context(gTabWidget); gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK); @@ -878,7 +886,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g if (border.top < 2) return 2; /* some themes don't set ythickness correctly */ -@@ -2290,7 +2456,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan +@@ -2290,7 +2463,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan gtk_style_context_save(style); moz_gtk_tab_prepare_style_context(style, flags); @@ -887,7 +895,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g focusRect.x += padding.left; focusRect.width -= (padding.left + padding.right); -@@ -2406,7 +2572,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * +@@ -2406,7 +2579,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * } static gint @@ -896,7 +904,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g GtkTextDirection direction) { GtkStyleContext* style; -@@ -2467,7 +2633,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr +@@ -2467,7 +2640,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); style = gtk_widget_get_style_context(gMenuSeparatorWidget); @@ -905,7 +913,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g x = rect->x + border_width; y = rect->y + border_width; -@@ -2521,7 +2687,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk +@@ -2521,7 +2694,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk item_widget = gMenuItemWidget; } style = gtk_widget_get_style_context(item_widget); @@ -915,7 +923,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g if (flags & MOZ_TOPLEVEL_MENU_ITEM) { gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR); -@@ -2540,7 +2707,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk +@@ -2540,7 +2714,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk gtk_render_background(style, cr, x, y, w, h); gtk_render_frame(style, cr, x, y, w, h); @@ -924,7 +932,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } return MOZ_GTK_SUCCESS; -@@ -2556,7 +2723,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd +@@ -2556,7 +2730,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd ensure_menu_item_widget(); gtk_widget_set_direction(gMenuItemWidget, direction); @@ -936,7 +944,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g style = gtk_widget_get_style_context(gMenuItemWidget); gtk_style_context_save(style); gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM); -@@ -2606,7 +2776,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c +@@ -2606,7 +2783,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c } gtk_style_context_set_state(style, state_flags); @@ -945,7 +953,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) + padding.left + 2; -@@ -2658,7 +2828,7 @@ moz_gtk_add_style_border(GtkStyleContext +@@ -2658,7 +2835,7 @@ moz_gtk_add_style_border(GtkStyleContext { GtkBorder border; @@ -954,7 +962,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g *left += border.left; *right += border.right; -@@ -2667,12 +2837,22 @@ moz_gtk_add_style_border(GtkStyleContext +@@ -2667,12 +2844,22 @@ moz_gtk_add_style_border(GtkStyleContext } static void @@ -978,7 +986,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g *left += padding.left; *right += padding.right; -@@ -2680,6 +2860,16 @@ moz_gtk_add_style_padding(GtkStyleContex +@@ -2680,6 +2867,16 @@ moz_gtk_add_style_padding(GtkStyleContex *bottom += padding.bottom; } @@ -995,14 +1003,14 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gint moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top, gint* right, gint* bottom, GtkTextDirection direction, -@@ -2694,36 +2884,27 @@ moz_gtk_get_widget_border(GtkThemeWidget +@@ -2694,36 +2891,27 @@ moz_gtk_get_widget_border(GtkThemeWidget case MOZ_GTK_TOOLBAR_BUTTON: { ensure_button_widget(); - style = gtk_widget_get_style_context(gButtonWidget); - -- *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget)); - +- *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget)); + - if (widget == MOZ_GTK_TOOLBAR_BUTTON) { - gtk_style_context_save(style); - gtk_style_context_add_class(style, "image-button"); @@ -1039,7 +1047,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -2759,7 +2940,7 @@ moz_gtk_get_widget_border(GtkThemeWidget +@@ -2759,7 +2947,7 @@ moz_gtk_get_widget_border(GtkThemeWidget break; case MOZ_GTK_DROPDOWN_ENTRY: ensure_combo_box_entry_widgets(); @@ -1048,7 +1056,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_DROPDOWN_ARROW: ensure_combo_box_entry_widgets(); -@@ -2795,7 +2976,7 @@ moz_gtk_get_widget_border(GtkThemeWidget +@@ -2795,7 +2983,7 @@ moz_gtk_get_widget_border(GtkThemeWidget if (!wide_separators) { style = gtk_widget_get_style_context(gComboBoxSeparatorWidget); @@ -1057,7 +1065,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g separator_width = border.left; } } -@@ -2814,14 +2995,17 @@ moz_gtk_get_widget_border(GtkThemeWidget +@@ -2814,14 +3002,17 @@ moz_gtk_get_widget_border(GtkThemeWidget w = gTabWidget; break; case MOZ_GTK_PROGRESSBAR: @@ -1079,7 +1087,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_SCALE_HORIZONTAL: ensure_scale_widget(); -@@ -2840,12 +3024,13 @@ moz_gtk_get_widget_border(GtkThemeWidget +@@ -2840,12 +3031,13 @@ moz_gtk_get_widget_border(GtkThemeWidget { if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) { ensure_checkbox_widget(); @@ -1096,7 +1104,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w)); moz_gtk_add_style_border(style, -@@ -2978,6 +3163,32 @@ moz_gtk_get_combo_box_entry_button_size( +@@ -2978,6 +3170,32 @@ moz_gtk_get_combo_box_entry_button_size( } gint @@ -1129,7 +1137,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height) { gint arrow_size; -@@ -3022,7 +3233,7 @@ moz_gtk_get_toolbar_separator_width(gint +@@ -3022,7 +3240,7 @@ moz_gtk_get_toolbar_separator_width(gint "separator-width", &separator_width, NULL); /* Just in case... */ @@ -1138,7 +1146,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g *size = MAX(*size, (wide_separators ? separator_width : border.left)); return MOZ_GTK_SUCCESS; } -@@ -3064,7 +3275,7 @@ moz_gtk_get_menu_separator_height(gint * +@@ -3064,7 +3282,7 @@ moz_gtk_get_menu_separator_height(gint * border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); style = gtk_widget_get_style_context(gMenuSeparatorWidget); @@ -1147,7 +1155,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gtk_style_context_save(style); gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR); -@@ -3122,15 +3333,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro +@@ -3122,15 +3340,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro { ensure_scrollbar_widget(); @@ -1172,7 +1180,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g return MOZ_GTK_SUCCESS; } -@@ -3155,7 +3372,7 @@ moz_gtk_images_in_buttons() +@@ -3155,7 +3379,7 @@ moz_gtk_images_in_buttons() GtkSettings* settings; ensure_button_widget(); @@ -1181,7 +1189,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g g_object_get(settings, "gtk-button-images", &result, NULL); return result; -@@ -3183,7 +3400,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType +@@ -3183,7 +3407,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType } ensure_button_widget(); return moz_gtk_button_paint(cr, rect, state, @@ -1190,7 +1198,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g direction); break; case MOZ_GTK_CHECKBUTTON: -@@ -3233,7 +3450,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType +@@ -3233,7 +3457,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType case MOZ_GTK_SPINBUTTON_ENTRY: ensure_spin_widget(); return moz_gtk_entry_paint(cr, rect, state, @@ -1199,7 +1207,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_GRIPPER: return moz_gtk_gripper_paint(cr, rect, state, -@@ -3260,7 +3477,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType +@@ -3260,7 +3484,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType case MOZ_GTK_ENTRY: ensure_entry_widget(); return moz_gtk_entry_paint(cr, rect, state, @@ -1208,7 +1216,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_DROPDOWN: return moz_gtk_combo_box_paint(cr, rect, state, direction); -@@ -3272,7 +3489,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType +@@ -3272,7 +3496,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType case MOZ_GTK_DROPDOWN_ENTRY: ensure_combo_box_entry_widgets(); return moz_gtk_entry_paint(cr, rect, state, @@ -1217,7 +1225,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_CHECKBUTTON_CONTAINER: case MOZ_GTK_RADIOBUTTON_CONTAINER: -@@ -3324,7 +3541,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType +@@ -3324,7 +3548,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType (GtkArrowType) flags, direction); break; case MOZ_GTK_MENUBAR: @@ -1226,7 +1234,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g break; case MOZ_GTK_MENUPOPUP: return moz_gtk_menu_popup_paint(cr, rect, direction); -@@ -3375,7 +3592,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( +@@ -3375,7 +3599,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( { MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); ensure_scrollbar_widget(); @@ -1235,7 +1243,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g } gboolean moz_gtk_has_scrollbar_buttons(void) -@@ -3383,7 +3600,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v +@@ -3383,7 +3607,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v gboolean backward, forward, secondary_backward, secondary_forward; MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); ensure_scrollbar_widget(); @@ -1244,7 +1252,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g "has-backward-stepper", &backward, "has-forward-stepper", &forward, "has-secondary-backward-stepper", &secondary_backward, -@@ -3409,17 +3626,19 @@ moz_gtk_shutdown() +@@ -3409,17 +3633,19 @@ moz_gtk_shutdown() gProtoWindow = NULL; gProtoLayout = NULL; @@ -1271,7 +1279,7 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gComboBoxWidget = NULL; gComboBoxButtonWidget = NULL; gComboBoxSeparatorWidget = NULL; -@@ -3427,12 +3646,12 @@ moz_gtk_shutdown() +@@ -3427,12 +3653,12 @@ moz_gtk_shutdown() gComboBoxEntryWidget = NULL; gComboBoxEntryButtonWidget = NULL; gComboBoxEntryArrowWidget = NULL; @@ -1286,9 +1294,9 @@ diff -up firefox-45.0.1/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.1/widget/g gTabWidget = NULL; gTooltipWidget = NULL; gMenuBarWidget = NULL; -diff -up firefox-45.0.1/widget/gtk/gtkdrawing.h.gtk3-20 firefox-45.0.1/widget/gtk/gtkdrawing.h ---- firefox-45.0.1/widget/gtk/gtkdrawing.h.gtk3-20 2016-03-15 23:37:46.000000000 +0100 -+++ firefox-45.0.1/widget/gtk/gtkdrawing.h 2016-04-05 14:40:27.847088629 +0200 +diff -up firefox-45.0.2/widget/gtk/gtkdrawing.h.gtk3-20 firefox-45.0.2/widget/gtk/gtkdrawing.h +--- firefox-45.0.2/widget/gtk/gtkdrawing.h.gtk3-20 2016-04-08 01:55:04.000000000 +0200 ++++ firefox-45.0.2/widget/gtk/gtkdrawing.h 2016-04-20 15:00:29.468048948 +0200 @@ -67,6 +67,13 @@ typedef enum { MOZ_GTK_TAB_SELECTED = 1 << 10 } GtkTabFlags; @@ -1327,9 +1335,9 @@ diff -up firefox-45.0.1/widget/gtk/gtkdrawing.h.gtk3-20 firefox-45.0.1/widget/gt #ifdef __cplusplus } #endif /* __cplusplus */ -diff -up firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c ---- firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 2016-04-05 14:40:27.799088451 +0200 -+++ firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c 2016-04-05 15:16:17.401430826 +0200 +diff -up firefox-45.0.2/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-45.0.2/widget/gtk/mozgtk/mozgtk.c +--- firefox-45.0.2/widget/gtk/mozgtk/mozgtk.c.gtk3-20 2016-04-20 15:00:29.443048846 +0200 ++++ firefox-45.0.2/widget/gtk/mozgtk/mozgtk.c 2016-04-20 15:00:29.469048952 +0200 @@ -503,6 +503,11 @@ STUB(gtk_window_set_type_hint) STUB(gtk_window_set_wmclass) STUB(gtk_window_unfullscreen) @@ -1364,9 +1372,9 @@ diff -up firefox-45.0.1/widget/gtk/mozgtk/mozgtk.c.gtk3-20 firefox-45.0.1/widget #endif #ifdef GTK2_SYMBOLS -diff -up firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp ---- firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-03-15 23:37:46.000000000 +0100 -+++ firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp 2016-04-05 14:40:27.848088632 +0200 +diff -up firefox-45.0.2/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-45.0.2/widget/gtk/nsLookAndFeel.cpp +--- firefox-45.0.2/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-04-08 01:55:04.000000000 +0200 ++++ firefox-45.0.2/widget/gtk/nsLookAndFeel.cpp 2016-04-20 15:00:29.469048952 +0200 @@ -232,14 +232,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI case eColorID_activeborder: // active window border @@ -1589,9 +1597,9 @@ diff -up firefox-45.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-45.0.1/widg #endif // Some themes have a unified menu bar, and support window dragging on it gboolean supports_menubar_drag = FALSE; -diff -up firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp ---- firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 2016-03-15 23:37:46.000000000 +0100 -+++ firefox-45.0.1/widget/gtk/nsNativeThemeGTK.cpp 2016-04-05 14:40:27.848088632 +0200 +diff -up firefox-45.0.2/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 firefox-45.0.2/widget/gtk/nsNativeThemeGTK.cpp +--- firefox-45.0.2/widget/gtk/nsNativeThemeGTK.cpp.gtk3-20 2016-04-08 01:55:04.000000000 +0200 ++++ firefox-45.0.2/widget/gtk/nsNativeThemeGTK.cpp 2016-04-20 15:00:29.469048952 +0200 @@ -1548,9 +1548,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n case NS_THEME_RADIO_CONTAINER: case NS_THEME_CHECKBOX_LABEL: From 97bd16c7cbaf718eb7f490c03f1896993960e621a50e694d2b4f9c7ced7e8edb Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Wed, 27 Apr 2016 07:09:13 +0000 Subject: [PATCH 04/12] - update to Firefox 46.0 (boo#977333) * Improved security of the JavaScript Just In Time (JIT) Compiler * WebRTC fixes to improve performance and stability * Added support for document.elementsFromPoint * Added HKDF support for Web Crypto API * requires NSPR 4.12 and NSS 3.22.3 * added patch to fix unchecked return value mozilla-check_return.patch * Gtk3 builds not supported at the moment security fixes: * MFSA 2016-39/CVE-2016-2804/CVE-2016-2806/CVE-2016-2807 Miscellaneous memory safety hazards * MFSA 2016-40/CVE-2016-2809 (bmo#1212939) Privilege escalation through file deletion by Maintenance Service updater (Windows only) * MFSA 2016-41/CVE-2016-2810 (bmo#1229681) Content provider permission bypass allows malicious application to access data (Android only) * MFSA 2016-42/CVE-2016-2811/CVE-2016-2812 (bmo#1252330, bmo#1261776) Use-after-free and buffer overflow in Service Workers * MFSA 2016-43/CVE-2016-2813 (bmo#1197901, bmo#2714650) Disclosure of user actions through JavaScript with motion and orientation sensors (only affects mobile variants) * MFSA 2016-44/CVE-2016-2814 (bmo#1254721) Buffer overflow in libstagefright with CENC offsets * MFSA 2016-45/CVE-2016-2816 (bmo#1223743) CSP not applied to pages sent with multipart/x-mixed-replace * MFSA 2016-46/CVE-2016-2817 (bmo#1227462) Elevation of privilege with chrome.tabs.update API in web extensions * MFSA 2016-47/CVE-2016-2808 (bmo#1246061) OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=500 --- MozillaFirefox.changes | 37 ++++++++++ MozillaFirefox.spec | 13 +++- compare-locales.tar.xz | 4 +- create-tar.sh | 15 +++- firefox-45.0.2-source.tar.xz | 3 - firefox-46.0-source.tar.xz | 3 + firefox-branded-icons.patch | 36 ++++----- firefox-kde.patch | 83 +++------------------ firefox-no-default-ualocale.patch | 6 +- l10n-45.0.2.tar.xz | 3 - l10n-46.0.tar.xz | 3 + l10n_changesets.txt | 90 +++++++++++++++++++++++ mozilla-check_return.patch | 58 +++++++++++++++ mozilla-kde.patch | 118 +++++++++++++++--------------- mozilla-repo.patch | 4 +- source-stamp.txt | 2 +- 16 files changed, 309 insertions(+), 169 deletions(-) delete mode 100644 firefox-45.0.2-source.tar.xz create mode 100644 firefox-46.0-source.tar.xz delete mode 100644 l10n-45.0.2.tar.xz create mode 100644 l10n-46.0.tar.xz create mode 100644 l10n_changesets.txt create mode 100644 mozilla-check_return.patch diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index 541714a..6662977 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,40 @@ +------------------------------------------------------------------- +Wed Apr 27 06:09:30 UTC 2016 - wr@rosenauer.org + +- update to Firefox 46.0 (boo#977333) + * Improved security of the JavaScript Just In Time (JIT) Compiler + * WebRTC fixes to improve performance and stability + * Added support for document.elementsFromPoint + * Added HKDF support for Web Crypto API + * requires NSPR 4.12 and NSS 3.22.3 + * added patch to fix unchecked return value + mozilla-check_return.patch + * Gtk3 builds not supported at the moment + security fixes: + * MFSA 2016-39/CVE-2016-2804/CVE-2016-2806/CVE-2016-2807 + Miscellaneous memory safety hazards + * MFSA 2016-40/CVE-2016-2809 (bmo#1212939) + Privilege escalation through file deletion by Maintenance Service updater + (Windows only) + * MFSA 2016-41/CVE-2016-2810 (bmo#1229681) + Content provider permission bypass allows malicious application + to access data (Android only) + * MFSA 2016-42/CVE-2016-2811/CVE-2016-2812 (bmo#1252330, bmo#1261776) + Use-after-free and buffer overflow in Service Workers + * MFSA 2016-43/CVE-2016-2813 (bmo#1197901, bmo#2714650) + Disclosure of user actions through JavaScript with motion and + orientation sensors (only affects mobile variants) + * MFSA 2016-44/CVE-2016-2814 (bmo#1254721) + Buffer overflow in libstagefright with CENC offsets + * MFSA 2016-45/CVE-2016-2816 (bmo#1223743) + CSP not applied to pages sent with multipart/x-mixed-replace + * MFSA 2016-46/CVE-2016-2817 (bmo#1227462) + Elevation of privilege with chrome.tabs.update API in web extensions + * MFSA 2016-47/CVE-2016-2808 (bmo#1246061) + Write to invalid HashMap entry through JavaScript.watch() + * MFSA 2016-48/CVE-2016-2820 (bmo#870870) + Firefox Health Reports could accept events from untrusted domains + ------------------------------------------------------------------- Thu Apr 21 12:00:28 UTC 2016 - badshah400@gmail.com diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 14570d3..7714dbd 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -18,10 +18,10 @@ # changed with every update -%define major 45 -%define mainver %major.0.2 +%define major 46 +%define mainver %major.0 %define update_channel release -%define releasedate 2016041100 +%define releasedate 2016042500 # general build definitions %if "%{update_channel}" != "aurora" @@ -78,7 +78,7 @@ BuildRequires: libnotify-devel BuildRequires: libproxy-devel BuildRequires: makeinfo BuildRequires: mozilla-nspr-devel >= 4.12 -BuildRequires: mozilla-nss-devel >= 3.21.1 +BuildRequires: mozilla-nss-devel >= 3.22.3 BuildRequires: nss-shared-helper-devel BuildRequires: python-devel BuildRequires: startup-notification-devel @@ -154,6 +154,7 @@ Source13: spellcheck.js Source14: create-tar.sh Source15: firefox-appdata.xml Source16: MozillaFirefox.changes +Source17: l10n_changesets.txt # Gecko/Toolkit Patch1: mozilla-nongnome-proxies.patch Patch2: mozilla-shared-nss-db.patch @@ -167,6 +168,7 @@ Patch10: mozilla-no-stdcxx-check.patch Patch11: mozilla-libproxy.patch Patch12: mozilla-reduce-files-per-UnifiedBindings.patch Patch13: mozilla-gtk3_20.patch +Patch14: mozilla-check_return.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-no-default-ualocale.patch @@ -280,6 +282,7 @@ cd $RPM_BUILD_DIR/mozilla %if 0%{?firefox_use_gtk3} %patch13 -p1 %endif +%patch14 -p1 # Firefox %patch101 -p1 %patch102 -p1 @@ -334,6 +337,8 @@ ac_add_options --includedir=%{_includedir} ac_add_options --enable-release %if 0%{?firefox_use_gtk3} ac_add_options --enable-default-toolkit=cairo-gtk3 +%else +ac_add_options --enable-default-toolkit=cairo-gtk2 %endif %ifarch %ix86 %arm %if 0%{?suse_version} > 1230 diff --git a/compare-locales.tar.xz b/compare-locales.tar.xz index dadb93d..70cda24 100644 --- a/compare-locales.tar.xz +++ b/compare-locales.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f37ce5f7f12518683b59fffe274845490bf6c75c65d1963d50907dc070025edf -size 28504 +oid sha256:c884758443bca687b9eccbaea6968cdc31af4a5fea46942b0f354903e0b53997 +size 28384 diff --git a/create-tar.sh b/create-tar.sh index 3d4bd64..5ddbfc6 100644 --- a/create-tar.sh +++ b/create-tar.sh @@ -1,9 +1,14 @@ #!/bin/bash +# TODO +# http://ftp.mozilla.org/pub/firefox/candidates/46.0-candidates/build5/linux-x86_64/en-US/firefox-46.0.json +# "moz_source_stamp": "078baf501b55eaa47f3b189fda4dd28dae1fa257" +# http://ftp.mozilla.org/pub/firefox/candidates/46.0-candidates/build5/l10n_changesets.txt + CHANNEL="release" BRANCH="releases/mozilla-$CHANNEL" -RELEASE_TAG="FIREFOX_45_0_2_RELEASE" -VERSION="45.0.2" +RELEASE_TAG="078baf501b55eaa47f3b189fda4dd28dae1fa257" +VERSION="46.0" # mozilla if [ -d mozilla ]; then @@ -46,9 +51,11 @@ for locale in $(awk '{ print $1; }' mozilla/browser/locales/shipped-locales); do ja-JP-mac|en-US) ;; *) - echo "fetching $locale ..." + echo "reading changeset information for $locale" + _changeset=$(grep ^$locale l10n_changesets.txt | awk '{ print $2; }') + echo "fetching $locale changeset $_changeset ..." hg clone http://hg.mozilla.org/releases/l10n/mozilla-$CHANNEL/$locale l10n/$locale - [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $RELEASE_TAG + [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $_changeset ;; esac done diff --git a/firefox-45.0.2-source.tar.xz b/firefox-45.0.2-source.tar.xz deleted file mode 100644 index 8857322..0000000 --- a/firefox-45.0.2-source.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:563784f3349fc217b2413e47bd01757d955e98c9ef636e273b154dc00fcfb5c8 -size 194204728 diff --git a/firefox-46.0-source.tar.xz b/firefox-46.0-source.tar.xz new file mode 100644 index 0000000..78f3382 --- /dev/null +++ b/firefox-46.0-source.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cb4575750b0e98120052a87d93cf2a9dcd6007d873fbf30707a453bb0e07b10 +size 196662288 diff --git a/firefox-branded-icons.patch b/firefox-branded-icons.patch index c53fb0d..8e00b27 100644 --- a/firefox-branded-icons.patch +++ b/firefox-branded-icons.patch @@ -1,6 +1,6 @@ # HG changeset patch # Parent e0751ad74e835e80041a61ea00c2a63bf6fbe2de -# Parent e3d8efdd7eea96ff7b8a7f6489a082cad72a98d8 +# Parent a5764b0a088418fdbf4b774a8ff2745cc99f6706 diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in --- a/browser/app/Makefile.in @@ -30,26 +30,26 @@ diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in diff --git a/browser/branding/branding-common.mozbuild b/browser/branding/branding-common.mozbuild --- a/browser/branding/branding-common.mozbuild +++ b/browser/branding/branding-common.mozbuild -@@ -32,12 +32,15 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co - 'disk.icns', - 'document.icns', - 'dsstore', - 'firefox.icns', - ] - elif CONFIG['MOZ_WIDGET_GTK']: - BRANDING_FILES += [ - 'default16.png', -+ 'default22.png', -+ 'default24.png', -+ 'default256.png', - 'default32.png', - 'default48.png', - 'mozicon128.png', - ] +@@ -34,12 +34,15 @@ def FirefoxBranding(): + 'disk.icns', + 'document.icns', + 'dsstore', + 'firefox.icns', + ] + elif CONFIG['MOZ_WIDGET_GTK']: + BRANDING_FILES += [ + 'default16.png', ++ 'default22.png', ++ 'default24.png', ++ 'default256.png', + 'default32.png', + 'default48.png', + 'mozicon128.png', + ] diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -665,18 +665,21 @@ +@@ -664,18 +664,21 @@ @RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/icon.png @RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf @RESPATH@/chrome/toolkit@JAREXT@ diff --git a/firefox-kde.patch b/firefox-kde.patch index cc19b79..572ac87 100644 --- a/firefox-kde.patch +++ b/firefox-kde.patch @@ -1,11 +1,11 @@ # HG changeset patch -# Parent 25d63ce139ad6e957d2565e3b83d01dfa36ea314 +# Parent f8b7b01caa34a2b2dbea6d47993ad7bbb7346a64 diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul new file mode 100644 --- /dev/null +++ b/browser/base/content/browser-kde.xul -@@ -0,0 +1,1181 @@ +@@ -0,0 +1,1175 @@ +#filter substitution + +# -*- Mode: HTML -*- @@ -16,7 +16,7 @@ new file mode 100644 + + + -+ ++ + + + @@ -617,9 +617,9 @@ new file mode 100644 + fullscreentoolbar="true" mode="icons" customizable="true" + iconsize="small" +#ifdef MOZ_DEV_EDITION -+ defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,pocket-button,downloads-button,home-button,loop-button" ++ defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,downloads-button,home-button,loop-button" +#else -+ defaultset="urlbar-container,search-container,bookmarks-menu-button,pocket-button,downloads-button,home-button,loop-button" ++ defaultset="urlbar-container,search-container,bookmarks-menu-button,downloads-button,home-button,loop-button" +#endif + customizationtarget="nav-bar-customization-target" + overflowable="true" @@ -795,7 +795,6 @@ new file mode 100644 + oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);" + onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);" + onpopupshowing="BookmarkingUI.onPopupShowing(event); -+ BookmarkingUI.updatePocketItemVisibility('BMB_'); + BookmarkingUI.attachPlacesView(event, this);" + tooltip="bhTooltip" popupsinherittooltip="true"> + + -+ -+ + prefs; -+ nsCOMPtr pserve(do_GetService(NS_PREFSERVICE_CONTRACTID)); -+ if (pserve) -+ pserve->GetBranch("", getter_AddRefs(prefs)); -+ -+ if (prefs) -+ prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult); -+ -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsKDEShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck) -+{ -+ nsCOMPtr prefs; -+ nsCOMPtr pserve(do_GetService(NS_PREFSERVICE_CONTRACTID)); -+ if (pserve) -+ pserve->GetBranch("", getter_AddRefs(prefs)); -+ -+ if (prefs) -+ prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck); -+ -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsKDEShellService::GetCanSetDesktopBackground(bool* aResult) -+{ -+ *aResult = true; -+ return NS_OK; -+} -+ -+NS_IMETHODIMP +nsKDEShellService::SetDesktopBackground(nsIDOMElement* aElement, + PRInt32 aPosition) +{ @@ -1685,9 +1624,9 @@ new file mode 100644 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -705,16 +705,17 @@ +@@ -703,16 +703,17 @@ + @RESPATH@/greprefs.js @RESPATH@/defaults/autoconfig/prefcalls.js - @RESPATH@/browser/defaults/profile/prefs.js @RESPATH@/browser/defaults/permissions ; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325) diff --git a/firefox-no-default-ualocale.patch b/firefox-no-default-ualocale.patch index e837060..fe9de2a 100644 --- a/firefox-no-default-ualocale.patch +++ b/firefox-no-default-ualocale.patch @@ -1,14 +1,14 @@ # HG changeset patch # User Wolfgang Rosenauer # Parent 099312626f5f7c9cb5573a61d0230574ee12a660 -# Parent ab1135c098843a4a4c5153bd361b964986fccefa +# Parent 8015dc2ad5992bfc7d33091fc92edf18ea220a89 Do not overwrite the locale dynamic pref from xulrunner's all.js with a wrong default value diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js -@@ -254,17 +254,17 @@ pref("browser.uitour.url", "https://www. - pref("browser.uitour.readerViewTrigger", "^https:\\/\\/www\\.mozilla\\.org\\/[^\\/]+\\/firefox\\/reading\\/start"); +@@ -216,17 +216,17 @@ pref("browser.uitour.readerViewTrigger", + pref("browser.uitour.surveyDuration", 7200); pref("browser.customizemode.tip0.shown", false); pref("browser.customizemode.tip0.learnMoreUrl", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/customize"); diff --git a/l10n-45.0.2.tar.xz b/l10n-45.0.2.tar.xz deleted file mode 100644 index 1e8c2b6..0000000 --- a/l10n-45.0.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5b92281ef0dd881e19767643e0b93d36592b346d9a845ebdcb58b13d46da1f28 -size 43337352 diff --git a/l10n-46.0.tar.xz b/l10n-46.0.tar.xz new file mode 100644 index 0000000..a29a8bd --- /dev/null +++ b/l10n-46.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bc6eea924fcb3edff637e9096678257d4f99ca65a79a56fc8d75eaab7759b9a +size 43714852 diff --git a/l10n_changesets.txt b/l10n_changesets.txt new file mode 100644 index 0000000..db9f5ed --- /dev/null +++ b/l10n_changesets.txt @@ -0,0 +1,90 @@ +ach 658769a76613 +af 431e02c10881 +an fe436c75f71d +ar bbcf06888dc5 +as 8313f975ae77 +ast 0300b60cd340 +az fd96727d2a26 +be b72077740aac +bg 9f7507dd2b92 +bn-BD fe0a6bb82a2d +bn-IN a2ea6b87d80d +br 95b028350e29 +bs cfee6f5b1e50 +ca e8ca2d46b4a8 +cs ed6004b91b51 +cy 5bbcbba9b054 +da 324fe068c0b9 +de 217ff3f0054a +dsb 7cdfb5d9dc5d +el 22b959c9a739 +en-GB 36012ab486ad +en-ZA 1c91f05aae5a +eo 049c1b065f4c +es-AR b3647b1d5927 +es-CL e45186f983b9 +es-ES 6fe131a8b07f +es-MX 4cd511663283 +et ecae9df9c92a +eu 1a65e2c03dda +fa e5993d9fb76e +ff 8373353b43c4 +fi b743718650bc +fr 7d0bb8edc149 +fy-NL 02ee99ad3f83 +ga-IE 713ecb614f77 +gd e5b86736a5f9 +gl c869caff337a +gn 65b2894520b6 +gu-IN 6245b4309461 +he ee92b661d299 +hi-IN bba2a926e4f8 +hr 8502beb4ee68 +hsb c91a11523487 +hu 09bbddfef7ee +hy-AM 3d7a9324fb25 +id cb8f841d30d2 +is 46c99105eb3b +it 6063a6d94e13 +ja 590a31fbf396 +ja-JP-mac 260664b702c5 +kk 5a7bd05bf942 +km 339790840ac1 +kn b23d8fbcf41a +ko 5f303ed16778 +lij e9113fac3a93 +lt 628e96e62e44 +lv 063998fdecf8 +mai ce010a305377 +mk ffdf2a789185 +ml 1b85d75836cd +mr 553ff31f4edd +ms 41bbf86ac0d9 +nb-NO 5e6e5710fac9 +nl ac486141ab40 +nn-NO be9e3eeb75fb +or febd1b04dbfc +pa-IN 6c5ed1be55fb +pl 49e141118acb +pt-BR cd1aef7b5045 +pt-PT 2e4fd2a1f98f +rm 0a52db6a6117 +ro c6ac34be77b1 +ru 3f0b3c8e19a4 +si 03a3b09a2203 +sk 3505a5f99bff +sl 1e098ab8c27a +son 3ae9a4ff0453 +sq c24e570a4207 +sr 896d72a0fa21 +sv-SE ea1de38fe731 +ta f9dbc2cca1fb +te 286ff9885ea2 +th d630f05d665f +tr b751d2d9b6ee +uk c5cdb9068667 +uz dc28cf99c5cf +vi 68ce305343a3 +xh f3eb8f92afe8 +zh-CN d73d448f89d6 +zh-TW 44c9950bb3e6 diff --git a/mozilla-check_return.patch b/mozilla-check_return.patch new file mode 100644 index 0000000..2e56356 --- /dev/null +++ b/mozilla-check_return.patch @@ -0,0 +1,58 @@ +# HG changeset patch +# User Wolfgang Rosenauer +# Parent 0d19d2f09730100d3eadd782f534b71cc4150650 + +diff --git a/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h b/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h +--- a/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h ++++ b/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h +@@ -25,25 +25,27 @@ public: + void WriteU8(uint8_t aByte) + { + mPtr.append(aByte); + } + + void WriteU16(uint16_t aShort) + { + uint8_t c[2]; ++ bool rv; + mozilla::BigEndian::writeUint16(&c[0], aShort); +- mPtr.append(&c[0], 2); ++ rv = mPtr.append(&c[0], 2); + } + + void WriteU32(uint32_t aLong) + { + uint8_t c[4]; ++ bool rv; + mozilla::BigEndian::writeUint32(&c[0], aLong); +- mPtr.append(&c[0], 4); ++ rv = mPtr.append(&c[0], 4); + } + + void Write32(int32_t aLong) + { + uint8_t c[4]; + mozilla::BigEndian::writeInt32(&c[0], aLong); + mPtr.append(&c[0], 4); + } +@@ -53,18 +55,19 @@ public: + uint8_t c[8]; + mozilla::BigEndian::writeUint64(&c[0], aLongLong); + mPtr.append(&c[0], 8); + } + + void Write64(int64_t aLongLong) + { + uint8_t c[8]; ++ bool rv; + mozilla::BigEndian::writeInt64(&c[0], aLongLong); +- mPtr.append(&c[0], 8); ++ rv = mPtr.append(&c[0], 8); + } + + void Write(const uint8_t* aSrc, size_t aCount) + { + mPtr.append(aSrc, aCount); + } + + private: diff --git a/mozilla-kde.patch b/mozilla-kde.patch index af162d7..fb689b9 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 797d5f17b080f54439602f107ecaf6b09a0ef5c1 +# Parent 61cdc9af8ceaf75083e751e0d6497feddc26f7ba Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -9,7 +9,7 @@ Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp -@@ -30,16 +30,17 @@ +@@ -31,16 +31,17 @@ #include "nsIZipReader.h" #include "nsPrefBranch.h" #include "nsXPIDLString.h" @@ -27,7 +27,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp #include "prefread.h" #include "prefapi_private_data.h" -@@ -1136,16 +1137,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char +@@ -1135,16 +1136,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char static nsresult pref_LoadPrefsInDirList(const char *listId) { @@ -62,7 +62,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp return NS_OK; bool hasMore; -@@ -1161,17 +1180,17 @@ static nsresult pref_LoadPrefsInDirList( +@@ -1160,17 +1179,17 @@ static nsresult pref_LoadPrefsInDirList( nsAutoCString leaf; path->GetNativeLeafName(leaf); @@ -81,7 +81,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp { nsZipItemPtr manifest(jarReader, name, true); NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); -@@ -1265,26 +1284,38 @@ static nsresult pref_InitInitialObjects( +@@ -1264,24 +1283,36 @@ static nsresult pref_InitInitialObjects( /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ static const char* specialFiles[] = { #if defined(XP_MACOSX) @@ -91,9 +91,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp #elif defined(XP_UNIX) "unix.js" + , "" // placeholder for KDE (empty is otherwise harmless) - #if defined(VMS) - , "openvms.js" - #elif defined(_AIX) + #if defined(_AIX) , "aix.js" #endif #elif defined(XP_BEOS) @@ -189,7 +187,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build --- a/toolkit/components/downloads/moz.build +++ b/toolkit/components/downloads/moz.build -@@ -65,15 +65,16 @@ if not CONFIG['MOZ_SUITE']: +@@ -64,15 +64,16 @@ if not CONFIG['MOZ_SUITE']: 'nsDownloadManagerUI.js', 'nsDownloadManagerUI.manifest', ] @@ -278,31 +276,31 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn -@@ -64,29 +64,33 @@ toolkit.jar: +@@ -72,29 +72,33 @@ toolkit.jar: content/global/viewZoomOverlay.js - *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) + content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) content/global/bindings/browser.xml (widgets/browser.xml) content/global/bindings/button.xml (widgets/button.xml) content/global/bindings/checkbox.xml (widgets/checkbox.xml) content/global/bindings/colorpicker.xml (widgets/colorpicker.xml) content/global/bindings/datetimepicker.xml (widgets/datetimepicker.xml) - *+ content/global/bindings/dialog.xml (widgets/dialog.xml) -+*+ content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml) + * content/global/bindings/dialog.xml (widgets/dialog.xml) ++* content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml) +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde content/global/bindings/editor.xml (widgets/editor.xml) content/global/bindings/expander.xml (widgets/expander.xml) - * content/global/bindings/filefield.xml (widgets/filefield.xml) - *+ content/global/bindings/findbar.xml (widgets/findbar.xml) + content/global/bindings/filefield.xml (widgets/filefield.xml) + * content/global/bindings/findbar.xml (widgets/findbar.xml) content/global/bindings/general.xml (widgets/general.xml) content/global/bindings/groupbox.xml (widgets/groupbox.xml) - *+ content/global/bindings/listbox.xml (widgets/listbox.xml) + content/global/bindings/listbox.xml (widgets/listbox.xml) content/global/bindings/menu.xml (widgets/menu.xml) content/global/bindings/menulist.xml (widgets/menulist.xml) content/global/bindings/notification.xml (widgets/notification.xml) content/global/bindings/numberbox.xml (widgets/numberbox.xml) content/global/bindings/popup.xml (widgets/popup.xml) - *+ content/global/bindings/preferences.xml (widgets/preferences.xml) -+*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml) + * content/global/bindings/preferences.xml (widgets/preferences.xml) ++* content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml) +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde content/global/bindings/progressmeter.xml (widgets/progressmeter.xml) content/global/bindings/radio.xml (widgets/radio.xml) @@ -316,7 +314,7 @@ diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/di new file mode 100644 --- /dev/null +++ b/toolkit/content/widgets/dialog-kde.xml -@@ -0,0 +1,460 @@ +@@ -0,0 +1,463 @@ + +