Bug 1450657: Remove ResolveTag usage in nsMenuPopupFrame. r=bz
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Apr 2018 13:42:50 +0200
changeset 411571 479b6858ea6cf96b4842cf5ae78f3bf9e74d3278
parent 411570 d00d3cc678fdeab9b94b69aa759959a8dd45e35f
child 411638 ff0efa4132f0efd78af0910762aec7dcc1a8de66
child 411639 1806f9299f284aa5c3fb3ea3c7b74338cd446ed5
push id33762
push userebalazs@mozilla.com
push dateWed, 04 Apr 2018 09:42:59 +0000
treeherdermozilla-central@479b6858ea6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1450657
milestone61.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 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
@@ -153,24 +153,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