Bug 1389133 - Don't invalidate style content for missing widgets. r=karlt, a=gchang
authorMartin Stransky <stransky@redhat.com>
Thu, 10 Aug 2017 18:07:41 +0200
changeset 421274 f233560347548f022964499bf241668fb4abc4a1
parent 421273 9e27747354e0c803482fb55f66beb448f3c19062
child 421275 7f8bf90b70e08a479b867133ffe053b201d3170e
push id7644
push userryanvm@gmail.com
push dateMon, 21 Aug 2017 16:46:00 +0000
treeherdermozilla-beta@f23356034754 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, gchang
bugs1389133
milestone56.0
Bug 1389133 - Don't invalidate style content for missing widgets. r=karlt, a=gchang 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