зеркало из https://github.com/mozilla/pjs.git
Bug 210204 - Only use Mac system menu for root chrome shell XUL menus. Display all other XUL menus as on other platforms. r=bz, sr=roc
This commit is contained in:
Родитель
3d04f3e272
Коммит
84d7da96b6
|
@ -99,6 +99,7 @@
|
||||||
#include "nsContentCID.h"
|
#include "nsContentCID.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
|
#include "nsIDocShellTreeItem.h"
|
||||||
#include "nsObjectFrame.h"
|
#include "nsObjectFrame.h"
|
||||||
#include "nsRuleNode.h"
|
#include "nsRuleNode.h"
|
||||||
#include "nsIDOMMutationEvent.h"
|
#include "nsIDOMMutationEvent.h"
|
||||||
|
@ -4997,7 +4998,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
|
||||||
widgetData.mWindowType = eWindowType_popup;
|
widgetData.mWindowType = eWindowType_popup;
|
||||||
widgetData.mBorderStyle = eBorderStyle_default;
|
widgetData.mBorderStyle = eBorderStyle_default;
|
||||||
|
|
||||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
#ifdef XP_MACOSX
|
||||||
static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID);
|
static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID);
|
||||||
view->CreateWidget(kCPopUpCID, &widgetData, nsnull);
|
view->CreateWidget(kCPopUpCID, &widgetData, nsnull);
|
||||||
#else
|
#else
|
||||||
|
@ -5834,13 +5835,32 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||||
rv = NS_NewMenuFrame(mPresShell, &newFrame, (aTag != nsXULAtoms::menuitem));
|
rv = NS_NewMenuFrame(mPresShell, &newFrame, (aTag != nsXULAtoms::menuitem));
|
||||||
}
|
}
|
||||||
else if (aTag == nsXULAtoms::menubar) {
|
else if (aTag == nsXULAtoms::menubar) {
|
||||||
#if defined(XP_MAC) || defined(XP_MACOSX) // The Mac uses its native menu bar.
|
#ifdef XP_MACOSX
|
||||||
aHaltProcessing = PR_TRUE;
|
// On Mac OS X, we use the system menubar for any root chrome shell
|
||||||
return NS_OK;
|
// XUL menubars.
|
||||||
#else
|
PRBool isRootChromeShell = PR_FALSE;
|
||||||
|
nsCOMPtr<nsISupports> container = aState.mPresContext->GetContainer();
|
||||||
|
if (container) {
|
||||||
|
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||||
|
if (treeItem) {
|
||||||
|
PRInt32 type;
|
||||||
|
treeItem->GetItemType(&type);
|
||||||
|
if (nsIDocShellTreeItem::typeChrome == type) {
|
||||||
|
nsCOMPtr<nsIDocShellTreeItem> parent;
|
||||||
|
treeItem->GetParent(getter_AddRefs(parent));
|
||||||
|
isRootChromeShell = !parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isRootChromeShell) {
|
||||||
|
aHaltProcessing = PR_TRUE;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
processChildren = PR_TRUE;
|
processChildren = PR_TRUE;
|
||||||
rv = NS_NewMenuBarFrame(mPresShell, &newFrame);
|
rv = NS_NewMenuBarFrame(mPresShell, &newFrame);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (aTag == nsXULAtoms::popupgroup) {
|
else if (aTag == nsXULAtoms::popupgroup) {
|
||||||
// This frame contains child popups
|
// This frame contains child popups
|
||||||
|
|
Загрузка…
Ссылка в новой задаче