Index: layout/html/base/src/nsHRFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsHRFrame.cpp,v
retrieving revision 1.55
diff -u -r1.55 nsHRFrame.cpp
--- layout/html/base/src/nsHRFrame.cpp 8 Oct 2002 10:24:32 -0000 1.55
+++ layout/html/base/src/nsHRFrame.cpp 7 Dec 2002 02:20:18 -0000
@@ -82,13 +82,13 @@
};
nsresult
-NS_NewHRFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
+NS_NewHRFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
- HRuleFrame* it = new (aPresShell) HRuleFrame;
+ HRuleFrame* it = new (aPresContext) HRuleFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -134,14 +134,8 @@
}
if (isSelected) //check the display flags to see if we draw this frame selected.
{
- nsresult result;
- nsCOMPtr shell;
- result = aPresContext->GetShell(getter_AddRefs(shell));
- if (NS_FAILED(result))
- return result;
-
PRInt16 displaySelection = nsISelectionDisplay::DISPLAY_ALL;
- result = shell->GetSelectionFlags(&displaySelection);
+ nsresult result = aPresContext->GetSelectionFlags(&displaySelection);
if (NS_FAILED(result))
return result;
if (!(displaySelection & nsISelectionDisplay::DISPLAY_TEXT))
Index: layout/html/base/src/nsHTMLContainerFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp,v
retrieving revision 3.173
diff -u -r3.173 nsHTMLContainerFrame.cpp
--- layout/html/base/src/nsHTMLContainerFrame.cpp 17 Nov 2002 15:37:39 -0000 3.173
+++ layout/html/base/src/nsHTMLContainerFrame.cpp 7 Dec 2002 02:20:18 -0000
@@ -37,7 +37,6 @@
#include "nsHTMLContainerFrame.h"
#include "nsIRenderingContext.h"
#include "nsIPresContext.h"
-#include "nsIPresShell.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsCSSRendering.h"
@@ -123,9 +122,7 @@
// and frame construction. If painting is locked down, then we
// do not paint our children.
PRBool paintingSuppressed = PR_FALSE;
- nsCOMPtr shell;
- aPresContext->GetShell(getter_AddRefs(shell));
- shell->IsPaintingSuppressed(&paintingSuppressed);
+ aPresContext->IsPaintingSuppressed(&paintingSuppressed);
if (paintingSuppressed)
return NS_OK;
}
@@ -160,13 +157,9 @@
nsIFrame* nextFrame;
aFrame->GetNextSibling(&nextFrame);
- nsIPresShell* presShell;
- nsIStyleSet* styleSet;
- aPresContext->GetShell(&presShell);
- presShell->GetStyleSet(&styleSet);
- NS_RELEASE(presShell);
+ nsCOMPtr styleSet;
+ aPresContext->GetStyleSet(getter_AddRefs(styleSet));
styleSet->CreateContinuingFrame(aPresContext, aFrame, aOuterFrame, &nextInFlow);
- NS_RELEASE(styleSet);
if (nsnull == nextInFlow) {
return NS_ERROR_OUT_OF_MEMORY;
Index: layout/html/base/src/nsHTMLFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsHTMLFrame.cpp,v
retrieving revision 1.117
diff -u -r1.117 nsHTMLFrame.cpp
--- layout/html/base/src/nsHTMLFrame.cpp 9 Jul 2002 04:30:28 -0000 1.117
+++ layout/html/base/src/nsHTMLFrame.cpp 7 Dec 2002 02:20:19 -0000
@@ -57,7 +57,6 @@
#include "nsIDeviceContext.h"
#include "nsIScrollableView.h"
#include "nsLayoutAtoms.h"
-#include "nsIPresShell.h"
#include "nsIScrollPositionListener.h"
// for focus
@@ -100,16 +99,13 @@
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aFrameList);
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aOldFrame);
@@ -181,13 +177,13 @@
//----------------------------------------------------------------------
nsresult
-NS_NewCanvasFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
+NS_NewCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
- CanvasFrame* it = new (aPresShell)CanvasFrame;
+ CanvasFrame* it = new (aPresContext)CanvasFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -228,9 +224,7 @@
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext,aContent,aParent,aContext,aPrevInFlow);
- nsCOMPtr presShell;
- aPresContext->GetShell(getter_AddRefs(presShell));
- presShell->GetViewManager(getter_AddRefs(mViewManager));
+ aPresContext->GetViewManager(getter_AddRefs(mViewManager));
nsIScrollableView* scrollingView = nsnull;
mViewManager->GetRootScrollableView(&scrollingView);
@@ -261,9 +255,7 @@
PRBool hasFocus = PR_FALSE;
nsCOMPtr observer;
mViewManager->GetViewObserver(*getter_AddRefs(observer));
- nsCOMPtr shell = do_QueryInterface(observer);
- nsCOMPtr context;
- shell->GetPresContext(getter_AddRefs(context));
+ nsCOMPtr context = do_QueryInterface(observer);
nsCOMPtr container;
context->GetContainer(getter_AddRefs(container));
nsCOMPtr docShell(do_QueryInterface(container));
@@ -289,7 +281,6 @@
NS_IMETHODIMP
CanvasFrame::AppendFrames(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aFrameList)
{
@@ -316,7 +307,7 @@
nsHTMLReflowCommand* reflowCmd;
rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty);
if (NS_SUCCEEDED(rv)) {
- aPresShell.AppendReflowCommand(reflowCmd);
+ aPresContext->AppendReflowCommand(reflowCmd);
}
}
@@ -325,7 +316,6 @@
NS_IMETHODIMP
CanvasFrame::InsertFrames(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList)
@@ -338,7 +328,7 @@
if (aPrevFrame) {
rv = NS_ERROR_UNEXPECTED;
} else {
- rv = AppendFrames(aPresContext, aPresShell, aListName, aFrameList);
+ rv = AppendFrames(aPresContext, aListName, aFrameList);
}
return rv;
@@ -346,7 +336,6 @@
NS_IMETHODIMP
CanvasFrame::RemoveFrame(nsIPresContext* aPresContext,
- nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aOldFrame)
{
@@ -371,7 +360,7 @@
nsHTMLReflowCommand* reflowCmd;
rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty);
if (NS_SUCCEEDED(rv)) {
- aPresShell.AppendReflowCommand(reflowCmd);
+ aPresContext->AppendReflowCommand(reflowCmd);
}
} else {
Index: layout/html/base/src/nsHTMLParts.h
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsHTMLParts.h,v
retrieving revision 3.106
diff -u -r3.106 nsHTMLParts.h
--- layout/html/base/src/nsHTMLParts.h 28 Nov 2002 19:15:26 -0000 3.106
+++ layout/html/base/src/nsHTMLParts.h 7 Dec 2002 02:20:19 -0000
@@ -56,7 +56,6 @@
class nsIURI;
class nsString;
class nsIWebShell;
-class nsIPresShell;
class nsIChannel;
/**
@@ -96,7 +95,7 @@
// policies.
// Create a frame that supports "display: block" layout behavior
-extern nsresult NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
+extern nsresult NS_NewBlockFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame,
PRUint32 aFlags = 0);
// Special Generated Content Frame
@@ -107,103 +106,103 @@
// return the option frame
// By default, area frames will extend
// their height to cover any children that "stick out".
-extern nsresult NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
+extern nsresult NS_NewSelectsAreaFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame,
PRUint32 aFlags = NS_BLOCK_WRAP_SIZE);
// Create a basic area frame. By default, area frames will extend
// their height to cover any children that "stick out".
-extern nsresult NS_NewAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
+extern nsresult NS_NewAreaFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame,
PRUint32 aFlags = NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE);
// These AreaFrame's shrink wrap around their contents
-inline nsresult NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
- return NS_NewBlockFrame(aPresShell, aNewFrame,
+inline nsresult NS_NewTableCellInnerFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame) {
+ return NS_NewBlockFrame(aPresContext, aNewFrame,
NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame is the document root, a margin root, and the
// initial containing block for absolutely positioned elements
-inline nsresult NS_NewDocumentElementFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
- return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
+inline nsresult NS_NewDocumentElementFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame) {
+ return NS_NewAreaFrame(aPresContext, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame is a margin root, but does not shrink wrap
-inline nsresult NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
- return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
+inline nsresult NS_NewAbsoluteItemWrapperFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame) {
+ return NS_NewAreaFrame(aPresContext, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame shrink wraps
-inline nsresult NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
- return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP);
+inline nsresult NS_NewFloatingItemWrapperFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame) {
+ return NS_NewAreaFrame(aPresContext, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP);
}
// This type of AreaFrame doesn't use its own space manager and
// doesn't shrink wrap.
-inline nsresult NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
- return NS_NewAreaFrame(aPresShell, aNewFrame);
+inline nsresult NS_NewRelativeItemWrapperFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame) {
+ return NS_NewAreaFrame(aPresContext, aNewFrame);
}
-extern nsresult NS_NewBRFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
+extern nsresult NS_NewBRFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame);
-extern nsresult NS_NewCommentFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
-extern nsresult NS_NewHRFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
+extern nsresult NS_NewCommentFrame(nsIPresContext* aPresContext, nsIFrame** aFrameResult);
+extern nsresult NS_NewHRFrame(nsIPresContext* aPresContext, nsIFrame** aNewFrame);
// and