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
--- 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