Bug 284320. Remove the contentParentFrame hack in subdocument frames, along with the no-longer-used arg it used to be used for. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-01-06 17:29:50 -05:00
parent ae71ba3f9c
commit 709cd54c51
9 changed files with 53 additions and 119 deletions

View File

@ -3504,8 +3504,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
InitAndRestoreFrame(aState, aContent, geometricParent, nsnull, aNewOuterFrame);
nsHTMLContainerFrame::CreateViewForFrame(aNewOuterFrame, aContentParent,
PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewOuterFrame, PR_FALSE);
// Create the inner table frame
#ifdef MOZ_MATHML
@ -3585,8 +3584,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsFrameConstructorState& aStat
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, aContent, parentFrame, nsnull, aNewFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, PR_FALSE);
nsFrameItems childItems;
rv = ProcessChildren(aState, aContent, aStyleContext, aNewFrame,
@ -3638,7 +3636,7 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsFrameConstructorState& aSta
if (styleDisplay->IsScrollableOverflow()) {
// Create an area container for the frame
BuildScrollFrame(aState, aContent, aStyleContext, aNewFrame, parentFrame,
nsnull, scrollFrame, aStyleContext);
scrollFrame, aStyleContext);
}
else {
@ -3646,8 +3644,7 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsFrameConstructorState& aSta
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, aContent, parentFrame, nsnull, aNewFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, PR_FALSE);
}
if (!aIsPseudo) {
@ -3761,8 +3758,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsFrameConstructorState& aState,
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, aContent, parentFrame, nsnull, aNewFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, PR_FALSE);
if (!aIsPseudo) {
nsFrameItems childItems;
rv = ProcessChildren(aState, aContent, aStyleContext, aNewFrame, PR_TRUE,
@ -3892,8 +3888,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
// Initialize the table cell frame
InitAndRestoreFrame(aState, aContent, parentFrame, nsnull, aNewCellOuterFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(aNewCellOuterFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewCellOuterFrame, PR_FALSE);
// Resolve pseudo style and initialize the body cell frame
nsRefPtr<nsStyleContext> innerPseudoStyle;
@ -4229,8 +4224,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
*aNewFrame = frameItems.childList;
processChildren = PR_TRUE;
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(contentFrame, aParentFrame, PR_FALSE);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(contentFrame, PR_FALSE);
} else {
return NS_ERROR_FAILURE;
}
@ -4518,7 +4513,6 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
aDocElement,
styleContext,
viewportFrame,
nsnull,
rootPseudo,
PR_TRUE,
newFrame);
@ -4742,8 +4736,8 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
buttonFrame->Destroy();
return rv;
}
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(buttonFrame, aParentFrame, PR_FALSE);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(buttonFrame, PR_FALSE);
@ -4873,7 +4867,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
aState.GetGeometricParent(aStyleDisplay, aParentFrame),
nsnull, comboboxFrame);
nsHTMLContainerFrame::CreateViewForFrame(comboboxFrame, aParentFrame, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(comboboxFrame, PR_FALSE);
rv = aState.AddChild(comboboxFrame, aFrameItems, aContent, aStyleContext,
aParentFrame);
@ -5015,8 +5009,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
}
}
nsHTMLContainerFrame::CreateViewForFrame(scrollFrame, aParentFrame,
aBuildCombobox);
nsHTMLContainerFrame::CreateViewForFrame(scrollFrame, aBuildCombobox);
if (aBuildCombobox) {
// Give the drop-down list a popup widget
nsIView* view = scrollFrame->GetView();
@ -5040,8 +5033,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
nsStyleContext* scrolledPseudoStyle;
BuildScrollFrame(aState, aContent, aStyleContext, scrolledFrame,
geometricParent, aParentFrame, scrollFrame,
scrolledPseudoStyle);
geometricParent, scrollFrame, scrolledPseudoStyle);
if (aState.mFrameState && aState.mFrameManager) {
// Restore frame state for the scroll frame
@ -5089,7 +5081,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
// See if we need to create a view, e.g. the frame is absolutely
// positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Resolve style and initialize the frame
nsRefPtr<nsStyleContext> styleContext;
@ -5426,16 +5418,6 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
newFrame = NS_NewSubDocumentFrame(mPresShell, aStyleContext);
triedFrame = PR_TRUE;
if (newFrame) {
// the nsSubDocumentFrame needs to know about its content parent during ::Init.
// there is no reasonable way to get the value there.
// so we store it as a frame property.
nsCOMPtr<nsIAtom> contentParentAtom = do_GetAtom("contentParent");
aState.mPresContext->PropertyTable()->
SetProperty(newFrame, contentParentAtom,
aParentFrame, nsnull, nsnull);
}
}
else if (nsGkAtoms::spacer == aTag) {
NS_ASSERTION(!display->IsAbsolutelyPositioned() && !display->IsFloating(),
@ -5505,9 +5487,8 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
rv = InitAndRestoreFrame(aState, aContent, geometricParent, nsnull, newFrame);
NS_ASSERTION(NS_SUCCEEDED(rv), "InitAndRestoreFrame failed");
// See if we need to create a view, e.g. the frame is absolutely
// positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext,
aParentFrame);
@ -5931,7 +5912,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
if (display->IsScrollableOverflow()) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aState, aContent, aStyleContext, newFrame,
aParentFrame, nsnull, topFrame, aStyleContext);
aParentFrame, topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
aParentFrame = newFrame->GetParent();
@ -6022,7 +6003,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
if (mayBeScrollable && display->IsScrollableOverflow()) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aState, aContent, aStyleContext, newFrame,
aParentFrame, nsnull, topFrame, aStyleContext);
aParentFrame, topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
// XXXldb Do we really want to do this? The one case where it
@ -6083,7 +6064,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
(frameType == nsGkAtoms::XULLabelFrame)) {
*/
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
/*
} else {
@ -6172,7 +6153,6 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
nsIContent* aContent,
nsStyleContext* aContentStyle,
nsIFrame* aParentFrame,
nsIFrame* aContentParentFrame,
nsIAtom* aScrolledPseudo,
PRBool aIsRoot,
nsIFrame*& aNewFrame)
@ -6196,8 +6176,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
InitAndRestoreFrame(aState, aContent, aParentFrame, nsnull, gfxScrollFrame);
// Create a view
nsHTMLContainerFrame::CreateViewForFrame(gfxScrollFrame,
aContentParentFrame, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(gfxScrollFrame, PR_FALSE);
}
// if there are any anonymous children for the scroll frame, create
@ -6229,7 +6208,9 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIFrame* aScrollFrame,
// force the scrolled frame to have a view. The view will be parented to
// the correct anonymous inner view because the scrollframes override
// nsIFrame::GetParentViewForChildFrame.
nsHTMLContainerFrame::CreateViewForFrame(aScrolledFrame, nsnull, PR_TRUE);
nsHTMLContainerFrame::CreateViewForFrame(aScrolledFrame, PR_TRUE);
// XXXbz what's the point of the code after this in this method?
nsIView* view = aScrolledFrame->GetView();
if (!view)
return;
@ -6273,13 +6254,12 @@ nsCSSFrameConstructor::BuildScrollFrame(nsFrameConstructorState& aState,
nsStyleContext* aContentStyle,
nsIFrame* aScrolledFrame,
nsIFrame* aParentFrame,
nsIFrame* aContentParentFrame,
nsIFrame*& aNewFrame,
nsStyleContext*& aScrolledContentStyle)
{
nsRefPtr<nsStyleContext> scrolledContentStyle =
BeginBuildingScrollFrame(aState, aContent, aContentStyle, aParentFrame,
aContentParentFrame, nsCSSAnonBoxes::scrolledContent,
nsCSSAnonBoxes::scrolledContent,
PR_FALSE, aNewFrame);
aScrolledFrame->SetStyleContextWithoutNotification(scrolledContentStyle);
@ -6344,7 +6324,6 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
nsRefPtr<nsStyleContext> scrolledContentStyle
= BeginBuildingScrollFrame(aState, aContent, aStyleContext,
aState.GetGeometricParent(aDisplay, aParentFrame),
aParentFrame,
nsCSSAnonBoxes::scrolledContent,
PR_FALSE, newFrame);
@ -6834,7 +6813,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
InitAndRestoreFrame(aState, aContent, geometricParent, nsnull, newFrame);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext,
aParentFrame, isMath, isMath);
@ -7120,7 +7099,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
// children (if requested), and set the initial child list
if (newFrame != nsnull) {
InitAndRestoreFrame(aState, aContent, geometricParent, nsnull, newFrame);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, forceView);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, forceView);
rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext,
aParentFrame, isOuterSVGNode, isOuterSVGNode);
@ -7150,7 +7129,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
&blockFrame, childItems, PR_TRUE);
// Give the blockFrame a view so that GetOffsetTo works for descendants
// of blockFrame with views...
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_TRUE);
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, PR_TRUE);
} else {
// Process the child content if requested.
rv = ProcessChildren(aState, aContent, aStyleContext, newFrame, PR_FALSE,
@ -10136,8 +10115,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShe
if (newFrame) {
newFrame->Init(aContent, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Create a continuing inner table frame, and if there's a caption then
// replicate the caption
@ -10183,8 +10161,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
if (newFrame) {
newFrame->Init(aContent, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Replicate any header/footer frames
nsFrameItems childFrames;
@ -10264,8 +10241,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::inlineFrame == frameType) {
@ -10273,8 +10249,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::blockFrame == frameType) {
@ -10282,8 +10257,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
#ifdef MOZ_XUL
@ -10292,8 +10266,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
#endif
} else if (nsGkAtoms::columnSetFrame == frameType) {
@ -10301,8 +10274,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::positionedInlineFrame == frameType) {
@ -10310,8 +10282,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::pageFrame == frameType) {
@ -10331,8 +10302,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::tableRowFrame == frameType) {
@ -10340,8 +10310,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Create a continuing frame for each table cell frame
nsFrameItems newChildList;
@ -10376,8 +10345,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Create a continuing area frame
nsIFrame* continuingBlockFrame;
@ -10399,8 +10367,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::letterFrame == frameType) {
@ -10408,8 +10375,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
}
} else if (nsGkAtoms::imageFrame == frameType) {
@ -10447,8 +10413,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(newFrame, PR_FALSE);
// Create a continuing area frame
// XXXbz we really shouldn't have to do this by hand!
@ -12335,7 +12300,6 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
// Create column wrapper if necessary
nsIFrame* blockFrame = *aNewFrame;
nsIFrame* parent = aParentFrame;
nsIFrame* contentParent = aContentParentFrame;
nsRefPtr<nsStyleContext> blockStyle = aStyleContext;
const nsStyleColumn* columns = aStyleContext->GetStyleColumn();
@ -12348,13 +12312,11 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
}
InitAndRestoreFrame(aState, aContent, aParentFrame, nsnull, columnSetFrame);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(columnSetFrame, aContentParentFrame,
PR_FALSE);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(columnSetFrame, PR_FALSE);
blockStyle = mPresShell->StyleSet()->
ResolvePseudoStyleFor(aContent, nsCSSAnonBoxes::columnContent,
aStyleContext);
contentParent = columnSetFrame;
parent = columnSetFrame;
*aNewFrame = columnSetFrame;
@ -12373,7 +12335,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
}
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, contentParent, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, PR_FALSE);
if (!mInitialContainingBlock) {
// The frame we're constructing will be the initial containing block.
@ -12435,8 +12397,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
// this is part of the fix for bug 42372
// Any inline frame might need a view (because of opacity, or fixed background)
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, PR_FALSE);
if (aIsPositioned) {
// Relatively positioned frames becomes a container for child
@ -12518,8 +12479,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
InitAndRestoreFrame(aState, aContent, aParentFrame, nsnull, blockFrame, PR_FALSE);
// Any inline frame could have a view (e.g., opacity)
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, PR_FALSE);
if (blockFrame->HasView() || aNewFrame->HasView()) {
// Move list2's frames into the new view
@ -12617,8 +12577,7 @@ nsCSSFrameConstructor::MoveFramesToEndOfIBSplit(nsFrameConstructorState& aState,
inlineFrame, PR_FALSE);
// Any frame might need a view
// XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(inlineFrame, nsnull, PR_FALSE);
nsHTMLContainerFrame::CreateViewForFrame(inlineFrame, PR_FALSE);
}
if (inlineFrame->HasView() || aFramesToMove->GetParent()->HasView()) {

View File

@ -809,13 +809,13 @@ private:
// Calls BeginBuildingScrollFrame, InitAndRestoreFrame, and then FinishBuildingScrollFrame.
// Sets the primary frame for the content to the output aNewFrame.
// @param aNewFrame the created scrollframe --- output only
// @param aParentFrame the geometric parent that the scrollframe will have.
nsresult
BuildScrollFrame(nsFrameConstructorState& aState,
nsIContent* aContent,
nsStyleContext* aContentStyle,
nsIFrame* aScrolledFrame,
nsIFrame* aParentFrame,
nsIFrame* aContentParentFrame,
nsIFrame*& aNewFrame,
nsStyleContext*& aScrolledChildStyle);
@ -825,7 +825,6 @@ private:
nsIContent* aContent,
nsStyleContext* aContentStyle,
nsIFrame* aParentFrame,
nsIFrame* aContentParentFrame,
nsIAtom* aScrolledPseudo,
PRBool aIsRoot,
nsIFrame*& aNewFrame);

View File

@ -6727,7 +6727,7 @@ nsFrame::SetParent(const nsIFrame* aParent)
if (aParent && aParent->IsBoxFrame()) {
if (aParent->ChildrenMustHaveWidgets()) {
nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE);
nsHTMLContainerFrame::CreateViewForFrame(this, PR_TRUE);
nsIView* view = GetView();
if (!view->HasWidget())
CreateWidgetForView(view);

View File

@ -283,23 +283,7 @@ nsSubDocumentFrame::Init(nsIContent* aContent,
// really need it or not, and the inner view will get it as the
// parent.
if (!HasView()) {
// To properly initialize the view we need to know the frame for the content
// that is the parent of content for this frame. This might not be our actual
// frame parent if we are out of flow (e.g., positioned) so our parent frame
// may have been set to some other ancestor.
// We look for a content parent frame in the frame property list, where it
// will have been set by nsCSSFrameConstructor if necessary.
nsCOMPtr<nsIAtom> contentParentAtom = do_GetAtom("contentParent");
nsIFrame* contentParent = nsnull;
void *value =
aPresContext->PropertyTable()->UnsetProperty(this,
contentParentAtom, &rv);
if (NS_SUCCEEDED(rv)) {
contentParent = (nsIFrame*)value;
}
rv = nsHTMLContainerFrame::CreateViewForFrame(this, contentParent, PR_TRUE);
rv = nsHTMLContainerFrame::CreateViewForFrame(this, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
}
nsIView* view = GetView();

View File

@ -677,7 +677,6 @@ nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext,
nsresult
nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
nsIFrame* aContentParentFrame,
PRBool aForce)
{
if (aFrame->HasView()) {

View File

@ -87,15 +87,8 @@ public:
/**
* Helper method to wrap views around frames. Used by containers
* under special circumstances (can be used by leaf frames as well)
* @param aContentParentFrame
* if non-null, this is the frame
* which would have held aFrame except that aFrame was reparented
* to an alternative geometric parent. This is necessary
* so that aFrame can remember to get its Z-order from
* aContentParentFrame.
*/
static nsresult CreateViewForFrame(nsIFrame* aFrame,
nsIFrame* aContentParentFrame,
PRBool aForce);
static nsresult ReparentFrameView(nsPresContext* aPresContext,

View File

@ -204,7 +204,7 @@ nsBoxFrame::Init(nsIContent* aContent,
// see if we need a widget
if (aParent && aParent->IsBoxFrame()) {
if (aParent->ChildrenMustHaveWidgets()) {
rv = nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE);
rv = nsHTMLContainerFrame::CreateViewForFrame(this, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
nsIView* view = GetView();

View File

@ -101,7 +101,7 @@ nsLeafBoxFrame::Init(
// see if we need a widget
if (aParent && aParent->IsBoxFrame()) {
if (aParent->ChildrenMustHaveWidgets()) {
rv = nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE);
rv = nsHTMLContainerFrame::CreateViewForFrame(this, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
nsIView* view = GetView();

View File

@ -377,7 +377,7 @@ nsSplitterFrame::Init(nsIContent* aContent,
nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv);
rv = nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE);
rv = nsHTMLContainerFrame::CreateViewForFrame(this, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
if (!realTimeDrag) {