Bug 1546658 - Clean up MOZ_GTK_DROPDOWN_ENTRY at widget style cache, r=dao
authorMartin Stransky <stransky@redhat.com>
Tue, 30 Apr 2019 08:25:24 +0000
changeset 530739 44829dfb74d2147e9c2cb0b45dacad650bfe4782
parent 530738 5179e588a94f9d8143ad18c0e4f4684aa37e9f3b
child 530740 eb532b01e59209fdbd14b37baa2ab65317bd3e0a
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1546658
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546658 - Clean up MOZ_GTK_DROPDOWN_ENTRY at widget style cache, r=dao Differential Revision: https://phabricator.services.mozilla.com/D29252
widget/gtk/WidgetStyleCache.cpp
--- a/widget/gtk/WidgetStyleCache.cpp
+++ b/widget/gtk/WidgetStyleCache.cpp
@@ -657,19 +657,16 @@ static void CreateHeaderBarButtons() {
 
 static void CreateHeaderBar() {
   CreateHeaderBarWidget(MOZ_GTK_HEADER_BAR);
   CreateHeaderBarWidget(MOZ_GTK_HEADER_BAR_MAXIMIZED);
   CreateHeaderBarButtons();
 }
 
 static GtkWidget* CreateWidget(WidgetNodeType aAppearance) {
-  MOZ_ASSERT(aAppearance != MOZ_GTK_DROPDOWN_ENTRY,
-             "Callers should be passing MOZ_GTK_ENTRY");
-
   switch (aAppearance) {
     case MOZ_GTK_WINDOW:
       return CreateWindowWidget();
     case MOZ_GTK_WINDOW_CONTAINER:
       return CreateWindowContainerWidget();
     case MOZ_GTK_CHECKBUTTON_CONTAINER:
       return CreateCheckboxWidget();
     case MOZ_GTK_PROGRESSBAR:
@@ -702,16 +699,17 @@ static GtkWidget* CreateWidget(WidgetNod
       return CreateSpinWidget();
     case MOZ_GTK_BUTTON:
       return CreateButtonWidget();
     case MOZ_GTK_TOGGLE_BUTTON:
       return CreateToggleButtonWidget();
     case MOZ_GTK_BUTTON_ARROW:
       return CreateButtonArrowWidget();
     case MOZ_GTK_ENTRY:
+    case MOZ_GTK_DROPDOWN_ENTRY:
       return CreateEntryWidget();
     case MOZ_GTK_SCROLLED_WINDOW:
       return CreateScrolledWindowWidget();
     case MOZ_GTK_TREEVIEW:
       return CreateTreeViewWidget();
     case MOZ_GTK_TREE_HEADER_CELL:
       return CreateTreeHeaderCellWidget();
     case MOZ_GTK_TREE_HEADER_SORTARROW:
@@ -1344,20 +1342,16 @@ void ResetWidgetCache(void) {
 
   /* Clear already freed arrays */
   mozilla::PodArrayZero(sWidgetStorage);
 }
 
 GtkStyleContext* GetStyleContext(WidgetNodeType aNodeType, int aScale,
                                  GtkTextDirection aDirection,
                                  GtkStateFlags aStateFlags) {
-  if (aNodeType == MOZ_GTK_DROPDOWN_ENTRY) {
-    aNodeType = MOZ_GTK_ENTRY;
-  }
-
   GtkStyleContext* style;
   if (gtk_check_version(3, 20, 0) != nullptr) {
     style = GetWidgetStyleInternal(aNodeType);
   } else {
     style = GetCssNodeStyleInternal(aNodeType);
     StyleContextSetScale(style, aScale);
   }
   bool stateChanged = false;