diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index c08a99a1e95..193f021191e 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -161,7 +161,9 @@ #include "nsIObserverService.h" #include "nsIXULAppInfo.h" #include "nsNetUtil.h" +#ifdef MOZ_XUL #include "nsXULPopupManager.h" +#endif #include "plbase64.h" @@ -3038,6 +3040,7 @@ nsGlobalWindow::SetScreenY(PRInt32 aScreenY) nsresult nsGlobalWindow::CheckSecurityWidthAndHeight(PRInt32* aWidth, PRInt32* aHeight) { +#ifdef MOZ_XUL if (!nsContentUtils::IsCallerTrustedForWrite()) { // if attempting to resize the window, hide any open popups nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); @@ -3045,6 +3048,7 @@ nsGlobalWindow::CheckSecurityWidthAndHeight(PRInt32* aWidth, PRInt32* aHeight) if (pm && doc) pm->HidePopupsInDocument(doc); } +#endif // This one is easy. Just ensure the variable is greater than 100; if ((aWidth && *aWidth < 100) || (aHeight && *aHeight < 100)) { @@ -3072,11 +3076,13 @@ nsGlobalWindow::CheckSecurityLeftAndTop(PRInt32* aLeft, PRInt32* aTop) // Check security state for use in determing window dimensions if (!nsContentUtils::IsCallerTrustedForWrite()) { +#ifdef MOZ_XUL // if attempting to move the window, hide any open popups nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); nsCOMPtr doc(do_QueryInterface(mDocument)); if (pm && doc) pm->HidePopupsInDocument(doc); +#endif PRInt32 screenLeft, screenTop, screenWidth, screenHeight; PRInt32 winLeft, winTop, winWidth, winHeight; diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index beeeb39f968..5bafa294cde 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -13064,6 +13064,7 @@ nsCSSFrameConstructor::LazyGenerateChildrenEvent::Run() // this is hard-coded to handle only menu popup frames nsIFrame* frame = mPresShell->GetPrimaryFrameFor(mContent); if (frame && frame->GetType() == nsGkAtoms::menuPopupFrame) { +#ifdef MOZ_XUL // it is possible that the frame is different than the one that requested // the lazy generation, but as long as it's a popup frame that hasn't // generated its children yet, that's OK. @@ -13073,6 +13074,7 @@ nsCSSFrameConstructor::LazyGenerateChildrenEvent::Run() // indicate that the children have been generated menuPopupFrame->SetGeneratedChildren(); +#endif nsFrameItems childItems; nsFrameConstructorState state(mPresShell, nsnull, nsnull, nsnull); diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 7b91a737bfc..d2093c459ae 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -109,8 +109,8 @@ #include "nsIDOMHTMLFrameSetElement.h" #ifdef MOZ_XUL #include "nsIXULDocument.h" -#endif #include "nsXULPopupManager.h" +#endif #include "nsPrintfCString.h" #include "nsIClipboardHelper.h" @@ -1151,11 +1151,13 @@ DocumentViewerImpl::PageHide(PRBool aIsUnload) nsEventDispatcher::Dispatch(window, mPresContext, &event, nsnull, &status); } +#ifdef MOZ_XUL // look for open menupopups and close them after the unload event, in case // the unload event listeners open any new popups nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm && mDocument) pm->HidePopupsInDocument(mDocument); +#endif return NS_OK; } diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index eb2301f9a72..27d04b04b0b 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -5418,6 +5418,7 @@ PresShell::HandleEvent(nsIView *aView, if (framePresContext == rootPresContext && frame == FrameManager()->GetRootFrame()) { +#ifdef MOZ_XUL nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm) { nsTArray popups = pm->GetOpenPopups(); @@ -5433,6 +5434,7 @@ PresShell::HandleEvent(nsIView *aView, } } } +#endif } nsPoint eventPoint diff --git a/mozilla/layout/build/nsLayoutStatics.cpp b/mozilla/layout/build/nsLayoutStatics.cpp index 048777582ee..80248eae2d7 100644 --- a/mozilla/layout/build/nsLayoutStatics.cpp +++ b/mozilla/layout/build/nsLayoutStatics.cpp @@ -79,10 +79,10 @@ #include "nsCellMap.h" #include "nsTextFrameTextRunCache.h" #include "nsCCUncollectableMarker.h" -#include "nsXULPopupManager.h" #include "nsTextFragment.h" #ifdef MOZ_XUL +#include "nsXULPopupManager.h" #include "nsXULContentUtils.h" #include "nsXULElement.h" #include "nsXULPrototypeCache.h" @@ -220,11 +220,13 @@ nsLayoutStatics::Initialize() return rv; } +#ifdef MOZ_XUL rv = nsXULPopupManager::Init(); if (NS_FAILED(rv)) { NS_ERROR("Could not initialize nsXULPopupManager"); return rv; } +#endif return NS_OK; } @@ -232,7 +234,9 @@ nsLayoutStatics::Initialize() void nsLayoutStatics::Shutdown() { +#ifdef MOZ_XUL nsXULPopupManager::Shutdown(); +#endif nsDOMStorageManager::Shutdown(); txMozillaXSLTProcessor::Shutdown(); nsDOMAttribute::Shutdown(); diff --git a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp index a1098a9ec6b..45e0dd704b1 100644 --- a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp +++ b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp @@ -58,7 +58,9 @@ #include "nsIScriptContext.h" #include "nsPIDOMWindow.h" #include "nsContentUtils.h" +#ifdef MOZ_XUL #include "nsXULPopupManager.h" +#endif #include "nsIRootBox.h" nsXULTooltipListener* nsXULTooltipListener::mInstance = nsnull; @@ -507,7 +509,6 @@ nsXULTooltipListener::LaunchTooltip() // Because of mutation events, mCurrentTooltip can be null. return; } -#endif nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm) { @@ -516,16 +517,20 @@ nsXULTooltipListener::LaunchTooltip() if (!pm->IsPopupOpen(mCurrentTooltip)) mCurrentTooltip = nsnull; } +#endif + } nsresult nsXULTooltipListener::HideTooltip() { +#ifdef MOZ_XUL if (mCurrentTooltip) { nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm) pm->HidePopup(mCurrentTooltip, PR_FALSE, PR_FALSE, PR_FALSE); } +#endif DestroyTooltip(); return NS_OK;