Bug 1597465 - Fix uses of nsCSSFrameConstructor::FindXULMenubarData in layout/base/nsCSSFrameConstructor.cpp. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D58482

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tetsuharu OHZEKI 2020-01-03 14:57:14 +00:00
Родитель 3512d966e5
Коммит 18799a7fc4
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -16,6 +16,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindContext.h"
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/GeneratedImageContent.h"
#include "mozilla/dom/HTMLDetailsElement.h"
#include "mozilla/dom/HTMLSelectElement.h"
@ -4119,11 +4120,10 @@ nsCSSFrameConstructor::FindXULDescriptionData(const Element& aElement,
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULMenubarData(const Element& aElement,
ComputedStyle&) {
nsCOMPtr<nsIDocShell> treeItem = aElement.OwnerDoc()->GetDocShell();
if (treeItem && nsIDocShellTreeItem::typeChrome == treeItem->ItemType()) {
nsCOMPtr<nsIDocShellTreeItem> parent;
treeItem->GetInProcessParent(getter_AddRefs(parent));
if (!parent) {
if (aElement.OwnerDoc()->IsInChromeDocShell()) {
BrowsingContext* bc = aElement.OwnerDoc()->GetBrowsingContext();
bool isRoot = bc && !bc->GetParent();
if (isRoot) {
// This is the root. Suppress the menubar, since on Mac
// window menus are not attached to the window.
static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA();