Bug 1450657: Remove ResolveTag usage in nsMenuPopupFrame. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Apr 2018 13:42:50 +0200
changeset 776021 72032264b2d2dfbde9a4649201f447a5f98224cb
parent 776020 860fa64b88a03ba16895e896b240f26fe9b4573e
child 776035 877b4f35fe87fda6d057d0c30218ba2039cb004c
child 776036 085f26c85295cfee8874e34be3ac413c3f2eb44b
push id104783
push userbmo:emilio@crisal.io
push dateMon, 02 Apr 2018 11:51:15 +0000
reviewersbz
bugs1450657
milestone61.0a1
Bug 1450657: Remove ResolveTag usage in nsMenuPopupFrame. r?bz We never extend xul:tooltip, xul:menupopup or xul:popup, so this can go away. MozReview-Commit-ID: LZsGYRdI5tW
layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -154,24 +154,20 @@ nsMenuPopupFrame::Init(nsIContent*      
   // XXX Hack. The popup's view should float above all other views,
   // so we use the nsView::SetFloating() to tell the view manager
   // about that constraint.
   nsView* ourView = GetView();
   nsViewManager* viewManager = ourView->GetViewManager();
   viewManager->SetViewFloating(ourView, true);
 
   mPopupType = ePopupTypePanel;
-  nsIDocument* doc = aContent->OwnerDoc();
-  int32_t namespaceID;
-  RefPtr<nsAtom> tag = doc->BindingManager()->ResolveTag(aContent, &namespaceID);
-  if (namespaceID == kNameSpaceID_XUL) {
-    if (tag == nsGkAtoms::menupopup || tag == nsGkAtoms::popup)
-      mPopupType = ePopupTypeMenu;
-    else if (tag == nsGkAtoms::tooltip)
-      mPopupType = ePopupTypeTooltip;
+  if (aContent->IsAnyOfXULElements(nsGkAtoms::menupopup, nsGkAtoms::popup)) {
+    mPopupType = ePopupTypeMenu;
+  } else if (aContent->IsXULElement(nsGkAtoms::tooltip)) {
+    mPopupType = ePopupTypeTooltip;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> dsti = PresContext()->GetDocShell();
   if (dsti && dsti->ItemType() == nsIDocShellTreeItem::typeChrome) {
     mInContentShell = false;
   }
 
   // To improve performance, create the widget for the popup only if it is not