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