From 4de121dc633a55cec7bb23bfc5572aa8676abdc9 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Sun, 1 Oct 2000 05:24:00 +0000 Subject: [PATCH] Restores INCLUDE_XUL #define. b=54248. r/a=hyatt@netscape.com --- content/base/src/nsDocumentViewer.cpp | 2 +- content/html/document/src/nsHTMLDocument.cpp | 2 +- content/xbl/src/nsXBLService.cpp | 6 +- layout/base/nsCSSFrameConstructor.cpp | 63 ++++++++++++++----- layout/base/nsDocumentViewer.cpp | 2 +- layout/base/nsPresContext.cpp | 5 -- layout/base/nsPresShell.cpp | 9 +-- layout/base/src/nsDocumentViewer.cpp | 2 +- layout/base/src/nsPresContext.cpp | 5 -- layout/html/base/src/nsPresShell.cpp | 9 +-- layout/html/document/src/nsHTMLDocument.cpp | 2 +- .../html/style/src/nsCSSFrameConstructor.cpp | 63 ++++++++++++++----- layout/xbl/src/nsXBLService.cpp | 6 +- 13 files changed, 113 insertions(+), 63 deletions(-) diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index eac4b24b37a9..23a1a16aedac 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -1192,7 +1192,7 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument, (*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet); } } - return rv; + return NS_OK; } nsresult diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index afe56a80ab36..142542f846a4 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -804,7 +804,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if (scheme && nsCRT::strcasecmp("about", scheme) && (kCharsetFromBookmarks > charsetSource)) { nsCOMPtr datasource; - if (NS_SUCCEEDED(rv_detect = gRDF->GetDataSource("rdf:bookmarks", getter_AddRefs(datasource)))) + if (gRDF && NS_SUCCEEDED(rv_detect = gRDF->GetDataSource("rdf:bookmarks", getter_AddRefs(datasource)))) { nsCOMPtr bookmarks = do_QueryInterface(datasource); if (bookmarks) diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index b34608e0af84..0e7e13f75fbd 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -784,7 +784,7 @@ NS_IMETHODIMP nsXBLService::GetXBLDocumentInfo(const nsCString& aURLStr, nsIContent* aBoundElement, nsIXBLDocumentInfo** aResult) { *aResult = nsnull; - if (gXULUtils->UseXULCache()) { + if (gXULUtils && gXULUtils->UseXULCache()) { // The first line of defense is the chrome cache. // This cache crosses the entire product, so any XBL bindings that are // part of chrome will be reused across all XUL documents. @@ -1032,7 +1032,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, nsIDocument* aB // We've got a file. Check our XBL document cache. nsCOMPtr info; - if (gXULUtils->UseXULCache()) { + if (gXULUtils && gXULUtils->UseXULCache()) { // The first line of defense is the chrome cache. // This cache crosses the entire product, so that any XBL bindings that are // part of chrome will be reused across all XUL documents. @@ -1092,7 +1092,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, nsIDocument* aB // If the doc is a chrome URI, then we put it into the XUL cache. PRBool cached = PR_FALSE; - if (IsChromeURI(uri) && gXULUtils->UseXULCache()) { + if (IsChromeURI(uri) && gXULUtils && gXULUtils->UseXULCache()) { cached = PR_TRUE; gXULCache->PutXBLDocumentInfo(info); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 70832584eadd..b0a76a7b09e3 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -82,10 +82,13 @@ #include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" +#include "nsIMenuFrame.h" + +#include "nsBox.h" + #ifdef INCLUDE_XUL #include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULDocument.h" -#include "nsIMenuFrame.h" #endif // XXX - temporary, this is for GfxList View @@ -132,13 +135,9 @@ nsresult NS_NewPolylineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame); #endif -#ifdef INCLUDE_XUL -#include "nsXULAtoms.h" -#include "nsTreeIndentationFrame.h" +#include "nsDocument.h" #include "nsIDOMElement.h" #include "nsIDOMDocument.h" -#include "nsDocument.h" -#include "nsToolbarItemFrame.h" #include "nsIScrollable.h" #ifdef DEBUG @@ -147,6 +146,12 @@ static PRBool gReallyNoisyContentUpdates = PR_FALSE; static PRBool gNoisyInlineConstruction = PR_FALSE; #endif + +#ifdef INCLUDE_XUL +#include "nsXULAtoms.h" +#include "nsTreeIndentationFrame.h" +#include "nsToolbarItemFrame.h" + #include "nsXULTreeFrame.h" #include "nsXULTreeOuterGroupFrame.h" #include "nsXULTreeSliceFrame.h" @@ -3346,12 +3351,15 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, contentFrame->GetStyleContext(getter_AddRefs(styleContext)); } else { // otherwise build a box or a block +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { NS_NewBoxFrame(aPresShell, &contentFrame, PR_TRUE); } - else { + else +#endif + { NS_NewDocumentElementFrame(aPresShell, &contentFrame); isBlockFrame = PR_TRUE; @@ -3598,12 +3606,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, nsIAtom* rootPseudo; if (!isPaginated) { +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { NS_NewRootBoxFrame(aPresShell, &rootFrame); - } else { + } else +#endif + { NS_NewCanvasFrame(aPresShell, &rootFrame); } @@ -3650,11 +3661,14 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // Only need to create a scroll frame/view for cases 2 and 3. // Currently OVERFLOW_SCROLL isn't honored, as // scrollportview::SetScrollPref is not implemented. +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; // Never create scrollbars for XUL documents if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { isScrollable = PR_FALSE; - } else { + } else +#endif + { nsresult rv; nsCOMPtr container; if (nsnull != aPresContext) { @@ -3987,6 +4001,9 @@ nsCSSFrameConstructor::ConstructTextControlFrame(nsIPresShell* aPresShell PRBool nsCSSFrameConstructor::HasGfxScrollbars() { +#ifndef INCLUDE_XUL + return PR_FALSE; +#endif // Get the Prefs if (!mGotGfxPrefs) { nsCOMPtr pref(do_GetService(NS_PREF_CONTRACTID)); @@ -4060,7 +4077,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, aStyleContext, aParentFrame, PR_FALSE); - +#ifdef INCLUDE_XUL if (HasGfxScrollbars() && mDoGfxCombobox) { /////////////////////////////////////////////////////////////////// // Combobox - New GFX Implementation @@ -4234,7 +4251,9 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, aNewFrame = comboboxFrame; aFrameHasBeenInitialized = PR_TRUE; } - } else { + } else +#endif + { /////////////////////////////////////////////////////////////////// // Combobox - Old Native Implementation /////////////////////////////////////////////////////////////////// @@ -4318,7 +4337,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, } } } else if (HasGfxScrollbars() && mDoGfxListbox) { - +#ifdef INCLUDE_XUL /////////////////////////////////////////////////////////////////// // ListBox - New GFX Implementation /////////////////////////////////////////////////////////////////// @@ -4418,7 +4437,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, aNewFrame = listFrame; // yes we have already initialized our frame - aFrameHasBeenInitialized = PR_TRUE; + aFrameHasBeenInitialized = PR_TRUE; +#endif } else { /////////////////////////////////////////////////////////////////// // ListBox - Old Native Implementation @@ -4616,7 +4636,7 @@ nsCSSFrameConstructor::ConstructTitledBoxFrame(nsIPresShell* aPresShell, nsIFrame * boxFrame; NS_NewTitledBoxInnerFrame(shell, &boxFrame); - +#ifdef INCLUDE_XUL // Resolve style and initialize the frame nsIStyleContext* styleContext; aPresContext->ResolvePseudoStyleContextFor(aContent, nsXULAtoms::titledboxContentPseudo, @@ -4625,7 +4645,7 @@ nsCSSFrameConstructor::ConstructTitledBoxFrame(nsIPresShell* aPresShell, newFrame, styleContext, nsnull, boxFrame); NS_RELEASE(styleContext); - +#endif nsFrameItems childItems; ProcessChildren(aPresShell, aPresContext, aState, aContent, boxFrame, PR_FALSE, @@ -5411,7 +5431,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, // nsGenericElement::SetDocument ought to keep a list like this one, // but it can't because nsGfxScrollFrames get around this. - +#ifdef INCLUDE_XUL if (aTag != nsHTMLAtoms::input && aTag != nsHTMLAtoms::textarea && aTag != nsHTMLAtoms::combobox && @@ -5422,7 +5442,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, return NS_OK; } - +#endif // get the document nsCOMPtr doc; nsresult rv = aParent->GetDocument(*getter_AddRefs(doc)); @@ -6415,6 +6435,7 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, nsIFrame*& aNewFrame, nsFrameItems& aAnonymousFrames) { +#ifdef INCLUDE_XUL NS_NewGfxScrollFrame(aPresShell, &aNewFrame, aDocument, aIsRoot); InitAndRestoreFrame(aPresContext, aState, aContent, @@ -6435,6 +6456,8 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, aAnonymousFrames); return NS_OK; +#endif + return NS_ERROR_FAILURE; } nsresult @@ -7011,6 +7034,8 @@ nsCSSFrameConstructor::InitAndRestoreFrame(nsIPresContext* aPresContext nsresult rv = NS_OK; NS_ASSERTION(aNewFrame, "Null frame cannot be initialized"); + if (!aNewFrame) + return NS_ERROR_NULL_POINTER; // Initialize the frame rv = aNewFrame->Init(aPresContext, aContent, aParentFrame, @@ -12235,6 +12260,7 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, PRBool aIsScrollbar, nsILayoutHistoryState* aFrameState) { +#ifdef INCLUDE_XUL nsCOMPtr shell; aPresContext->GetShell(getter_AddRefs(shell)); nsresult rv = NS_OK; @@ -12318,6 +12344,9 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, } return rv; +#else + return NS_ERROR_FAILURE; +#endif } //---------------------------------------- diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index eac4b24b37a9..23a1a16aedac 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -1192,7 +1192,7 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument, (*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet); } } - return rv; + return NS_OK; } nsresult diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 30bee2474ad9..cd8746191312 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1181,12 +1181,7 @@ nsPresContext::GetLanguageSpecificTransformType( nsLanguageSpecificTransformType* aType) { NS_ENSURE_ARG_POINTER(aType); - NS_ASSERTION(mLanguageSpecificTransformType != - eLanguageSpecificTransformType_Unknown, - "language specific transform type not set yet"); - *aType = mLanguageSpecificTransformType; - return NS_OK; } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index dc759fc10bfe..5f534c3741cb 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2082,7 +2082,8 @@ NS_IMETHODIMP PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ if (!aFrame) return NS_ERROR_NULL_POINTER; - + +#ifdef INCLUDE_XUL // Before we scroll the frame into view, ask the command dispatcher // if we're resetting focus because a window just got an activate // event. If we are, we do not want to scroll the frame into view. @@ -2123,7 +2124,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ } } } - +#endif if (IsScrollingEnabled()) return ScrollFrameIntoView(aFrame, NS_PRESSHELL_SCROLL_ANYWHERE, NS_PRESSHELL_SCROLL_ANYWHERE); @@ -2913,7 +2914,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, if (!aFrame) { return NS_ERROR_NULL_POINTER; } - +#ifdef INCLUDE_XUL // Before we scroll the frame into view, ask the command dispatcher // if we're resetting focus because a window just got an activate // event. If we are, we do not want to scroll the frame into view. @@ -2954,7 +2955,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, } } } - +#endif if (mViewManager) { // Get the viewport scroller nsIScrollableView* scrollingView; diff --git a/layout/base/src/nsDocumentViewer.cpp b/layout/base/src/nsDocumentViewer.cpp index eac4b24b37a9..23a1a16aedac 100644 --- a/layout/base/src/nsDocumentViewer.cpp +++ b/layout/base/src/nsDocumentViewer.cpp @@ -1192,7 +1192,7 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument, (*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet); } } - return rv; + return NS_OK; } nsresult diff --git a/layout/base/src/nsPresContext.cpp b/layout/base/src/nsPresContext.cpp index 30bee2474ad9..cd8746191312 100644 --- a/layout/base/src/nsPresContext.cpp +++ b/layout/base/src/nsPresContext.cpp @@ -1181,12 +1181,7 @@ nsPresContext::GetLanguageSpecificTransformType( nsLanguageSpecificTransformType* aType) { NS_ENSURE_ARG_POINTER(aType); - NS_ASSERTION(mLanguageSpecificTransformType != - eLanguageSpecificTransformType_Unknown, - "language specific transform type not set yet"); - *aType = mLanguageSpecificTransformType; - return NS_OK; } diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index dc759fc10bfe..5f534c3741cb 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -2082,7 +2082,8 @@ NS_IMETHODIMP PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ if (!aFrame) return NS_ERROR_NULL_POINTER; - + +#ifdef INCLUDE_XUL // Before we scroll the frame into view, ask the command dispatcher // if we're resetting focus because a window just got an activate // event. If we are, we do not want to scroll the frame into view. @@ -2123,7 +2124,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ } } } - +#endif if (IsScrollingEnabled()) return ScrollFrameIntoView(aFrame, NS_PRESSHELL_SCROLL_ANYWHERE, NS_PRESSHELL_SCROLL_ANYWHERE); @@ -2913,7 +2914,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, if (!aFrame) { return NS_ERROR_NULL_POINTER; } - +#ifdef INCLUDE_XUL // Before we scroll the frame into view, ask the command dispatcher // if we're resetting focus because a window just got an activate // event. If we are, we do not want to scroll the frame into view. @@ -2954,7 +2955,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, } } } - +#endif if (mViewManager) { // Get the viewport scroller nsIScrollableView* scrollingView; diff --git a/layout/html/document/src/nsHTMLDocument.cpp b/layout/html/document/src/nsHTMLDocument.cpp index afe56a80ab36..142542f846a4 100644 --- a/layout/html/document/src/nsHTMLDocument.cpp +++ b/layout/html/document/src/nsHTMLDocument.cpp @@ -804,7 +804,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if (scheme && nsCRT::strcasecmp("about", scheme) && (kCharsetFromBookmarks > charsetSource)) { nsCOMPtr datasource; - if (NS_SUCCEEDED(rv_detect = gRDF->GetDataSource("rdf:bookmarks", getter_AddRefs(datasource)))) + if (gRDF && NS_SUCCEEDED(rv_detect = gRDF->GetDataSource("rdf:bookmarks", getter_AddRefs(datasource)))) { nsCOMPtr bookmarks = do_QueryInterface(datasource); if (bookmarks) diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 70832584eadd..b0a76a7b09e3 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -82,10 +82,13 @@ #include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" +#include "nsIMenuFrame.h" + +#include "nsBox.h" + #ifdef INCLUDE_XUL #include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULDocument.h" -#include "nsIMenuFrame.h" #endif // XXX - temporary, this is for GfxList View @@ -132,13 +135,9 @@ nsresult NS_NewPolylineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame); #endif -#ifdef INCLUDE_XUL -#include "nsXULAtoms.h" -#include "nsTreeIndentationFrame.h" +#include "nsDocument.h" #include "nsIDOMElement.h" #include "nsIDOMDocument.h" -#include "nsDocument.h" -#include "nsToolbarItemFrame.h" #include "nsIScrollable.h" #ifdef DEBUG @@ -147,6 +146,12 @@ static PRBool gReallyNoisyContentUpdates = PR_FALSE; static PRBool gNoisyInlineConstruction = PR_FALSE; #endif + +#ifdef INCLUDE_XUL +#include "nsXULAtoms.h" +#include "nsTreeIndentationFrame.h" +#include "nsToolbarItemFrame.h" + #include "nsXULTreeFrame.h" #include "nsXULTreeOuterGroupFrame.h" #include "nsXULTreeSliceFrame.h" @@ -3346,12 +3351,15 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, contentFrame->GetStyleContext(getter_AddRefs(styleContext)); } else { // otherwise build a box or a block +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { NS_NewBoxFrame(aPresShell, &contentFrame, PR_TRUE); } - else { + else +#endif + { NS_NewDocumentElementFrame(aPresShell, &contentFrame); isBlockFrame = PR_TRUE; @@ -3598,12 +3606,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, nsIAtom* rootPseudo; if (!isPaginated) { +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { NS_NewRootBoxFrame(aPresShell, &rootFrame); - } else { + } else +#endif + { NS_NewCanvasFrame(aPresShell, &rootFrame); } @@ -3650,11 +3661,14 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // Only need to create a scroll frame/view for cases 2 and 3. // Currently OVERFLOW_SCROLL isn't honored, as // scrollportview::SetScrollPref is not implemented. +#ifdef INCLUDE_XUL PRInt32 nameSpaceID; // Never create scrollbars for XUL documents if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && nameSpaceID == nsXULAtoms::nameSpaceID) { isScrollable = PR_FALSE; - } else { + } else +#endif + { nsresult rv; nsCOMPtr container; if (nsnull != aPresContext) { @@ -3987,6 +4001,9 @@ nsCSSFrameConstructor::ConstructTextControlFrame(nsIPresShell* aPresShell PRBool nsCSSFrameConstructor::HasGfxScrollbars() { +#ifndef INCLUDE_XUL + return PR_FALSE; +#endif // Get the Prefs if (!mGotGfxPrefs) { nsCOMPtr pref(do_GetService(NS_PREF_CONTRACTID)); @@ -4060,7 +4077,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, aStyleContext, aParentFrame, PR_FALSE); - +#ifdef INCLUDE_XUL if (HasGfxScrollbars() && mDoGfxCombobox) { /////////////////////////////////////////////////////////////////// // Combobox - New GFX Implementation @@ -4234,7 +4251,9 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, aNewFrame = comboboxFrame; aFrameHasBeenInitialized = PR_TRUE; } - } else { + } else +#endif + { /////////////////////////////////////////////////////////////////// // Combobox - Old Native Implementation /////////////////////////////////////////////////////////////////// @@ -4318,7 +4337,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, } } } else if (HasGfxScrollbars() && mDoGfxListbox) { - +#ifdef INCLUDE_XUL /////////////////////////////////////////////////////////////////// // ListBox - New GFX Implementation /////////////////////////////////////////////////////////////////// @@ -4418,7 +4437,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, aNewFrame = listFrame; // yes we have already initialized our frame - aFrameHasBeenInitialized = PR_TRUE; + aFrameHasBeenInitialized = PR_TRUE; +#endif } else { /////////////////////////////////////////////////////////////////// // ListBox - Old Native Implementation @@ -4616,7 +4636,7 @@ nsCSSFrameConstructor::ConstructTitledBoxFrame(nsIPresShell* aPresShell, nsIFrame * boxFrame; NS_NewTitledBoxInnerFrame(shell, &boxFrame); - +#ifdef INCLUDE_XUL // Resolve style and initialize the frame nsIStyleContext* styleContext; aPresContext->ResolvePseudoStyleContextFor(aContent, nsXULAtoms::titledboxContentPseudo, @@ -4625,7 +4645,7 @@ nsCSSFrameConstructor::ConstructTitledBoxFrame(nsIPresShell* aPresShell, newFrame, styleContext, nsnull, boxFrame); NS_RELEASE(styleContext); - +#endif nsFrameItems childItems; ProcessChildren(aPresShell, aPresContext, aState, aContent, boxFrame, PR_FALSE, @@ -5411,7 +5431,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, // nsGenericElement::SetDocument ought to keep a list like this one, // but it can't because nsGfxScrollFrames get around this. - +#ifdef INCLUDE_XUL if (aTag != nsHTMLAtoms::input && aTag != nsHTMLAtoms::textarea && aTag != nsHTMLAtoms::combobox && @@ -5422,7 +5442,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, return NS_OK; } - +#endif // get the document nsCOMPtr doc; nsresult rv = aParent->GetDocument(*getter_AddRefs(doc)); @@ -6415,6 +6435,7 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, nsIFrame*& aNewFrame, nsFrameItems& aAnonymousFrames) { +#ifdef INCLUDE_XUL NS_NewGfxScrollFrame(aPresShell, &aNewFrame, aDocument, aIsRoot); InitAndRestoreFrame(aPresContext, aState, aContent, @@ -6435,6 +6456,8 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, aAnonymousFrames); return NS_OK; +#endif + return NS_ERROR_FAILURE; } nsresult @@ -7011,6 +7034,8 @@ nsCSSFrameConstructor::InitAndRestoreFrame(nsIPresContext* aPresContext nsresult rv = NS_OK; NS_ASSERTION(aNewFrame, "Null frame cannot be initialized"); + if (!aNewFrame) + return NS_ERROR_NULL_POINTER; // Initialize the frame rv = aNewFrame->Init(aPresContext, aContent, aParentFrame, @@ -12235,6 +12260,7 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, PRBool aIsScrollbar, nsILayoutHistoryState* aFrameState) { +#ifdef INCLUDE_XUL nsCOMPtr shell; aPresContext->GetShell(getter_AddRefs(shell)); nsresult rv = NS_OK; @@ -12318,6 +12344,9 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, } return rv; +#else + return NS_ERROR_FAILURE; +#endif } //---------------------------------------- diff --git a/layout/xbl/src/nsXBLService.cpp b/layout/xbl/src/nsXBLService.cpp index b34608e0af84..0e7e13f75fbd 100644 --- a/layout/xbl/src/nsXBLService.cpp +++ b/layout/xbl/src/nsXBLService.cpp @@ -784,7 +784,7 @@ NS_IMETHODIMP nsXBLService::GetXBLDocumentInfo(const nsCString& aURLStr, nsIContent* aBoundElement, nsIXBLDocumentInfo** aResult) { *aResult = nsnull; - if (gXULUtils->UseXULCache()) { + if (gXULUtils && gXULUtils->UseXULCache()) { // The first line of defense is the chrome cache. // This cache crosses the entire product, so any XBL bindings that are // part of chrome will be reused across all XUL documents. @@ -1032,7 +1032,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, nsIDocument* aB // We've got a file. Check our XBL document cache. nsCOMPtr info; - if (gXULUtils->UseXULCache()) { + if (gXULUtils && gXULUtils->UseXULCache()) { // The first line of defense is the chrome cache. // This cache crosses the entire product, so that any XBL bindings that are // part of chrome will be reused across all XUL documents. @@ -1092,7 +1092,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, nsIDocument* aB // If the doc is a chrome URI, then we put it into the XUL cache. PRBool cached = PR_FALSE; - if (IsChromeURI(uri) && gXULUtils->UseXULCache()) { + if (IsChromeURI(uri) && gXULUtils && gXULUtils->UseXULCache()) { cached = PR_TRUE; gXULCache->PutXBLDocumentInfo(info);