Bug 1389133 - don't invalidate style content for missing widgets, r?karlt draft
authorMartin Stransky <stransky@redhat.com>
Thu, 10 Aug 2017 18:07:41 +0200
changeset 644183 a7c0d47505bd242892a8b94c504cb3c884c9e70f
parent 643173 4c5fbf49376351679dcc49f4cff26c3c2e055ccc
child 725519 9e4cb668aea826c1bd0dda7213945523921e894f
push id73339
push userstransky@redhat.com
push dateThu, 10 Aug 2017 16:08:08 +0000
reviewerskarlt
bugs1389133
milestone57.0a1
Bug 1389133 - don't invalidate style content for missing widgets, r?karlt MozReview-Commit-ID: 2KfjYGvsiVv
widget/gtk/WidgetStyleCache.cpp
--- 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