Bug 1389133 - don't invalidate style content for missing widgets, r?karlt
MozReview-Commit-ID: 2KfjYGvsiVv
--- a/widget/gtk/WidgetStyleCache.cpp
+++ b/widget/gtk/WidgetStyleCache.cpp
@@ -617,16 +617,20 @@ CreateWidget(WidgetNodeType aWidgetType)
}
GtkWidget*
GetWidget(WidgetNodeType aWidgetType)
{
GtkWidget* widget = sWidgetStorage[aWidgetType];
if (!widget) {
widget = CreateWidget(aWidgetType);
+ // Some widgets (MOZ_GTK_COMBOBOX_SEPARATOR for instance) may not be
+ // available or implemented.
+ if (!widget)
+ return nullptr;
// In GTK versions prior to 3.18, automatic invalidation of style contexts
// for widgets was delayed until the next resize event. Gecko however,
// typically uses the style context before the resize event runs and so an
// explicit invalidation may be required. This is necessary if a style
// property was retrieved before all changes were made to the style
// context. One such situation is where gtk_button_construct_child()
// retrieves the style property "image-spacing" during construction of the
// GtkButton, before its parent is set to provide inheritance of ancestor