diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 553aaf92b3b..38345f457fa 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2502,7 +2502,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, outerStyleContext, nsnull, aNewOuterFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewOuterFrame, - outerStyleContext, PR_FALSE); + outerStyleContext, nsnull, PR_FALSE); // Create the inner table frame aTableCreator.CreateTableFrame(&aNewInnerFrame); @@ -3768,7 +3768,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, pageFrame->Init(aPresContext, nsnull, rootFrame, pagePseudoStyle, nsnull); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, pageFrame, - pagePseudoStyle, PR_TRUE); + pagePseudoStyle, nsnull, PR_TRUE); // The eventual parent of the document element frame mDocElementContainingBlock = pageFrame; @@ -4054,7 +4054,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, geometricParent, aStyleContext, nsnull, comboboxFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); if (HasGfxScrollbars() && mDoGfxCombobox) { /////////////////////////////////////////////////////////////////// @@ -4087,7 +4087,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, comboboxFrame, gfxListStyle, nsnull, listFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, listFrame, - gfxListStyle, PR_TRUE); + gfxListStyle, nsnull, PR_TRUE); nsIView * view; listFrame->GetView(aPresContext, &view); if (view != nsnull) { @@ -4502,7 +4502,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell, scrollFrame, scrolledPseudoStyle, nsnull, scrolledFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, scrolledFrame, - scrolledPseudoStyle, PR_TRUE); + scrolledPseudoStyle, nsnull, PR_TRUE); // The area frame is a floater container @@ -4710,7 +4710,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely // positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // cache our display type const nsStyleDisplay* styleDisplay; @@ -5064,7 +5064,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely // positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -6163,7 +6163,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, */ // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); /* } else { @@ -6317,7 +6317,7 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIPresContext* aPresConte { // create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aScrolledFrame, - aScrolledContentStyle, PR_TRUE); + aScrolledContentStyle, nsnull, PR_TRUE); // the the scroll frames child list aScrollFrame->SetInitialChildList(aPresContext, nsnull, aScrolledFrame); @@ -6448,7 +6448,7 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); nsIFrame* scrollbox = nsnull; NS_NewScrollPortFrame(aPresShell, &scrollbox); @@ -6610,7 +6610,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content. The area frame becomes a container for child // frames that are absolutely positioned @@ -6665,7 +6665,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content nsFrameConstructorSaveState floaterSaveState; @@ -6717,7 +6717,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Process the child content. Relatively positioned frames becomes a // container for child frames that are positioned @@ -7267,7 +7267,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -7378,7 +7378,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -9481,7 +9481,7 @@ ApplyRenderingChangeToTree(nsIPresContext* aPresContext, } if (viewManager) { - viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC); + viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC); NS_RELEASE(viewManager); } } @@ -10140,7 +10140,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell, } containerFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // If the frame is out-of-flow, then mark it as such if (isOutOfFlow) { @@ -10504,7 +10504,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Create a continuing inner table frame, and if there's a caption then // replicate the caption @@ -10585,7 +10585,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Replicate any header/footer frames nsIFrame* rowGroupFrame; @@ -10673,7 +10673,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::inlineFrame == frameType) { @@ -10681,7 +10681,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::blockFrame == frameType) { @@ -10689,7 +10689,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::areaFrame == frameType) { @@ -10698,7 +10698,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::positionedInlineFrame == frameType) { @@ -10706,7 +10706,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::pageFrame == frameType) { @@ -10714,7 +10714,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_TRUE); + styleContext, nsnull, PR_TRUE); } } else if (nsLayoutAtoms::tableOuterFrame == frameType) { @@ -10730,7 +10730,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::tableRowFrame == frameType) { @@ -10738,7 +10738,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); // Create a continuing frame for each table cell frame nsIFrame* cellFrame; @@ -10770,7 +10770,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); // Create a continuing area frame nsIFrame* areaFrame; @@ -10787,7 +10787,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::letterFrame == frameType) { @@ -10795,7 +10795,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else { @@ -12244,7 +12244,7 @@ nsCSSFrameConstructor::ConstructBlock(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // See if the block has first-letter style applied to it... PRBool haveFirstLetterStyle, haveFirstLineStyle; @@ -12379,7 +12379,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Relatively positioned frames becomes a container for child // frames that are positioned @@ -12492,7 +12492,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, blockFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); } MoveChildrenTo(aPresContext, blockSC, blockFrame, list2); @@ -12514,7 +12514,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); } if (list3) { diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index e18e07511fb..0fe84562a18 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -965,7 +965,7 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX, if (myList->mListStyleImage.Length() > 0) { mImageLoader.GetDesiredSize(aCX, &aReflowState, aMetrics); if (!mImageLoader.GetLoadImageFailed()) { - nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, + nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, nsnull, PR_FALSE); aMetrics.ascent = aMetrics.height; aMetrics.descent = 0; diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 0dc964aa562..5ee36bd00fe 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -179,6 +179,7 @@ ReparentFrameViewTo(nsIPresContext* aPresContext, aViewManager->RemoveChild(aOldParentView, view); // XXX We need to insert this view in the correct place within its z-order... + // XXX What should we do about the Z-placeholder-child if this frame is position:fixed? aViewManager->InsertChild(aNewParentView, view, zIndex); } else { @@ -416,14 +417,13 @@ nsresult nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIStyleContext* aStyleContext, + nsIFrame* aContentParentFrame, PRBool aForce) { nsIView* view; aFrame->GetView(aPresContext, &view); // If we don't yet have a view, see if we need a view if (nsnull == view) { - PRInt32 zIndex = 0; - PRBool autoZIndex = PR_FALSE; PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay @@ -431,7 +431,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleDisplay* display = (const nsStyleDisplay*) aStyleContext->GetStyleData(eStyleStruct_Display); - + const nsStylePosition* position = (const nsStylePosition*) + aStyleContext->GetStyleData(eStyleStruct_Position); + if (color->mOpacity != 1.0f) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g", @@ -448,36 +450,16 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // See if the frame is being relatively positioned or absolutely // positioned if (!aForce) { - const nsStylePosition* position = (const nsStylePosition*) - aStyleContext->GetStyleData(eStyleStruct_Position); - if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p relatively positioned", - aFrame)); + aFrame)); aForce = PR_TRUE; - - // Get the z-index to use - if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { - zIndex = position->mZIndex.GetIntValue(); - - } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { - autoZIndex = PR_TRUE; - } - } else if (position->IsAbsolutelyPositioned()) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, - ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p relatively positioned", - aFrame)); + ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p absolutely positioned", + aFrame)); aForce = PR_TRUE; - - // Get the z-index to use - if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { - zIndex = position->mZIndex.GetIntValue(); - - } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { - autoZIndex = PR_TRUE; - } } } @@ -522,12 +504,11 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, if (aForce) { // Create a view - nsIFrame* parent; + nsIFrame* parent = nsnull; + nsIView* parentView = nsnull; aFrame->GetParentWithView(aPresContext, &parent); NS_ASSERTION(parent, "GetParentWithView failed"); - nsIView* parentView; - parent->GetView(aPresContext, &parentView); NS_ASSERTION(parentView, "no parent with view"); @@ -563,11 +544,44 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(parentView->QueryInterface(kScrollViewIID, (void**)&scrollingView))) { scrollingView->SetScrolledView(view); } else { + PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; + + // Get the z-index to use + if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { + zIndex = position->mZIndex.GetIntValue(); + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; + } + viewManager->InsertChild(parentView, view, zIndex); if (autoZIndex) { viewManager->SetViewAutoZIndex(view, PR_TRUE); } + + if (nsnull != aContentParentFrame) { + // If, for some reason, GetView below fails to initialize zParentView, + // then ensure that we completely bypass InsertZPlaceholder below. + // The effect will be as if we never knew about aContentParentFrame + // in the first place, so at least this code won't be doing any damage. + nsIView* zParentView = parentView; + + aContentParentFrame->GetView(aPresContext, &zParentView); + + if (nsnull == zParentView) { + nsIFrame* zParentFrame = nsnull; + + aContentParentFrame->GetParentWithView(aPresContext, &zParentFrame); + NS_ASSERTION(zParentFrame, "GetParentWithView failed"); + zParentFrame->GetView(aPresContext, &zParentView); + NS_ASSERTION(zParentView, "no parent with view"); + } + + if (zParentView != parentView) { + viewManager->InsertZPlaceholder(zParentView, view, zIndex); + } + } } // See if the view should be hidden @@ -617,9 +631,6 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // XXX If it's fixed positioned, then create a widget so it floats // above the scrolling area - const nsStylePosition* position = (const nsStylePosition*) - aStyleContext->GetStyleData(eStyleStruct_Position); - if (NS_STYLE_POSITION_FIXED == position->mPosition) { view->CreateWidget(kCChildCID); } diff --git a/layout/generic/nsHTMLContainerFrame.h b/layout/generic/nsHTMLContainerFrame.h index 7887b877788..655fed445b2 100644 --- a/layout/generic/nsHTMLContainerFrame.h +++ b/layout/generic/nsHTMLContainerFrame.h @@ -62,11 +62,20 @@ public: nsIFrame* aFrame, nsIFrame*& aNextInFlowResult); - // Helper method to wrap views around frames. Used by containers - // under special circumstances (can be used by leaf frames as well) + /** + * 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(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIStyleContext* aStyleContext, + nsIFrame* aContentParentFrame, PRBool aForce); static nsresult ReparentFrameView(nsIPresContext* aPresContext, diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 7404f83a341..7f69073e44e 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -305,7 +305,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if(rv == NS_OK) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else diff --git a/layout/html/base/src/nsBulletFrame.cpp b/layout/html/base/src/nsBulletFrame.cpp index e18e07511fb..0fe84562a18 100644 --- a/layout/html/base/src/nsBulletFrame.cpp +++ b/layout/html/base/src/nsBulletFrame.cpp @@ -965,7 +965,7 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX, if (myList->mListStyleImage.Length() > 0) { mImageLoader.GetDesiredSize(aCX, &aReflowState, aMetrics); if (!mImageLoader.GetLoadImageFailed()) { - nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, + nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, nsnull, PR_FALSE); aMetrics.ascent = aMetrics.height; aMetrics.descent = 0; diff --git a/layout/html/base/src/nsHTMLContainerFrame.cpp b/layout/html/base/src/nsHTMLContainerFrame.cpp index 0dc964aa562..5ee36bd00fe 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -179,6 +179,7 @@ ReparentFrameViewTo(nsIPresContext* aPresContext, aViewManager->RemoveChild(aOldParentView, view); // XXX We need to insert this view in the correct place within its z-order... + // XXX What should we do about the Z-placeholder-child if this frame is position:fixed? aViewManager->InsertChild(aNewParentView, view, zIndex); } else { @@ -416,14 +417,13 @@ nsresult nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIStyleContext* aStyleContext, + nsIFrame* aContentParentFrame, PRBool aForce) { nsIView* view; aFrame->GetView(aPresContext, &view); // If we don't yet have a view, see if we need a view if (nsnull == view) { - PRInt32 zIndex = 0; - PRBool autoZIndex = PR_FALSE; PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay @@ -431,7 +431,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleDisplay* display = (const nsStyleDisplay*) aStyleContext->GetStyleData(eStyleStruct_Display); - + const nsStylePosition* position = (const nsStylePosition*) + aStyleContext->GetStyleData(eStyleStruct_Position); + if (color->mOpacity != 1.0f) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g", @@ -448,36 +450,16 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // See if the frame is being relatively positioned or absolutely // positioned if (!aForce) { - const nsStylePosition* position = (const nsStylePosition*) - aStyleContext->GetStyleData(eStyleStruct_Position); - if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p relatively positioned", - aFrame)); + aFrame)); aForce = PR_TRUE; - - // Get the z-index to use - if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { - zIndex = position->mZIndex.GetIntValue(); - - } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { - autoZIndex = PR_TRUE; - } - } else if (position->IsAbsolutelyPositioned()) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, - ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p relatively positioned", - aFrame)); + ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p absolutely positioned", + aFrame)); aForce = PR_TRUE; - - // Get the z-index to use - if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { - zIndex = position->mZIndex.GetIntValue(); - - } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { - autoZIndex = PR_TRUE; - } } } @@ -522,12 +504,11 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, if (aForce) { // Create a view - nsIFrame* parent; + nsIFrame* parent = nsnull; + nsIView* parentView = nsnull; aFrame->GetParentWithView(aPresContext, &parent); NS_ASSERTION(parent, "GetParentWithView failed"); - nsIView* parentView; - parent->GetView(aPresContext, &parentView); NS_ASSERTION(parentView, "no parent with view"); @@ -563,11 +544,44 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(parentView->QueryInterface(kScrollViewIID, (void**)&scrollingView))) { scrollingView->SetScrolledView(view); } else { + PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; + + // Get the z-index to use + if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { + zIndex = position->mZIndex.GetIntValue(); + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; + } + viewManager->InsertChild(parentView, view, zIndex); if (autoZIndex) { viewManager->SetViewAutoZIndex(view, PR_TRUE); } + + if (nsnull != aContentParentFrame) { + // If, for some reason, GetView below fails to initialize zParentView, + // then ensure that we completely bypass InsertZPlaceholder below. + // The effect will be as if we never knew about aContentParentFrame + // in the first place, so at least this code won't be doing any damage. + nsIView* zParentView = parentView; + + aContentParentFrame->GetView(aPresContext, &zParentView); + + if (nsnull == zParentView) { + nsIFrame* zParentFrame = nsnull; + + aContentParentFrame->GetParentWithView(aPresContext, &zParentFrame); + NS_ASSERTION(zParentFrame, "GetParentWithView failed"); + zParentFrame->GetView(aPresContext, &zParentView); + NS_ASSERTION(zParentView, "no parent with view"); + } + + if (zParentView != parentView) { + viewManager->InsertZPlaceholder(zParentView, view, zIndex); + } + } } // See if the view should be hidden @@ -617,9 +631,6 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // XXX If it's fixed positioned, then create a widget so it floats // above the scrolling area - const nsStylePosition* position = (const nsStylePosition*) - aStyleContext->GetStyleData(eStyleStruct_Position); - if (NS_STYLE_POSITION_FIXED == position->mPosition) { view->CreateWidget(kCChildCID); } diff --git a/layout/html/base/src/nsHTMLContainerFrame.h b/layout/html/base/src/nsHTMLContainerFrame.h index 7887b877788..655fed445b2 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.h +++ b/layout/html/base/src/nsHTMLContainerFrame.h @@ -62,11 +62,20 @@ public: nsIFrame* aFrame, nsIFrame*& aNextInFlowResult); - // Helper method to wrap views around frames. Used by containers - // under special circumstances (can be used by leaf frames as well) + /** + * 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(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIStyleContext* aStyleContext, + nsIFrame* aContentParentFrame, PRBool aForce); static nsresult ReparentFrameView(nsIPresContext* aPresContext, diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 7404f83a341..7f69073e44e 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -305,7 +305,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if(rv == NS_OK) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 553aaf92b3b..38345f457fa 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -2502,7 +2502,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, outerStyleContext, nsnull, aNewOuterFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewOuterFrame, - outerStyleContext, PR_FALSE); + outerStyleContext, nsnull, PR_FALSE); // Create the inner table frame aTableCreator.CreateTableFrame(&aNewInnerFrame); @@ -3768,7 +3768,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, pageFrame->Init(aPresContext, nsnull, rootFrame, pagePseudoStyle, nsnull); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, pageFrame, - pagePseudoStyle, PR_TRUE); + pagePseudoStyle, nsnull, PR_TRUE); // The eventual parent of the document element frame mDocElementContainingBlock = pageFrame; @@ -4054,7 +4054,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, geometricParent, aStyleContext, nsnull, comboboxFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); if (HasGfxScrollbars() && mDoGfxCombobox) { /////////////////////////////////////////////////////////////////// @@ -4087,7 +4087,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, comboboxFrame, gfxListStyle, nsnull, listFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, listFrame, - gfxListStyle, PR_TRUE); + gfxListStyle, nsnull, PR_TRUE); nsIView * view; listFrame->GetView(aPresContext, &view); if (view != nsnull) { @@ -4502,7 +4502,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell, scrollFrame, scrolledPseudoStyle, nsnull, scrolledFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, scrolledFrame, - scrolledPseudoStyle, PR_TRUE); + scrolledPseudoStyle, nsnull, PR_TRUE); // The area frame is a floater container @@ -4710,7 +4710,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely // positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // cache our display type const nsStyleDisplay* styleDisplay; @@ -5064,7 +5064,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely // positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -6163,7 +6163,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, */ // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); /* } else { @@ -6317,7 +6317,7 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIPresContext* aPresConte { // create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aScrolledFrame, - aScrolledContentStyle, PR_TRUE); + aScrolledContentStyle, nsnull, PR_TRUE); // the the scroll frames child list aScrollFrame->SetInitialChildList(aPresContext, nsnull, aScrolledFrame); @@ -6448,7 +6448,7 @@ nsCSSFrameConstructor::BuildGfxScrollFrame (nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); nsIFrame* scrollbox = nsnull; NS_NewScrollPortFrame(aPresShell, &scrollbox); @@ -6610,7 +6610,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content. The area frame becomes a container for child // frames that are absolutely positioned @@ -6665,7 +6665,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Process the child content nsFrameConstructorSaveState floaterSaveState; @@ -6717,7 +6717,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPresShell, // Create a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Process the child content. Relatively positioned frames becomes a // container for child frames that are positioned @@ -7267,7 +7267,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -7378,7 +7378,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, aParentFrame, PR_FALSE); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -9481,7 +9481,7 @@ ApplyRenderingChangeToTree(nsIPresContext* aPresContext, } if (viewManager) { - viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC); + viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC); NS_RELEASE(viewManager); } } @@ -10140,7 +10140,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell, } containerFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // If the frame is out-of-flow, then mark it as such if (isOutOfFlow) { @@ -10504,7 +10504,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Create a continuing inner table frame, and if there's a caption then // replicate the caption @@ -10585,7 +10585,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Replicate any header/footer frames nsIFrame* rowGroupFrame; @@ -10673,7 +10673,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::inlineFrame == frameType) { @@ -10681,7 +10681,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::blockFrame == frameType) { @@ -10689,7 +10689,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::areaFrame == frameType) { @@ -10698,7 +10698,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::positionedInlineFrame == frameType) { @@ -10706,7 +10706,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::pageFrame == frameType) { @@ -10714,7 +10714,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_TRUE); + styleContext, nsnull, PR_TRUE); } } else if (nsLayoutAtoms::tableOuterFrame == frameType) { @@ -10730,7 +10730,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::tableRowFrame == frameType) { @@ -10738,7 +10738,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); // Create a continuing frame for each table cell frame nsIFrame* cellFrame; @@ -10770,7 +10770,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); // Create a continuing area frame nsIFrame* areaFrame; @@ -10787,7 +10787,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::letterFrame == frameType) { @@ -10795,7 +10795,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, PR_FALSE); + styleContext, nsnull, PR_FALSE); } } else { @@ -12244,7 +12244,7 @@ nsCSSFrameConstructor::ConstructBlock(nsIPresShell* aPresShell, // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // See if the block has first-letter style applied to it... PRBool haveFirstLetterStyle, haveFirstLineStyle; @@ -12379,7 +12379,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); // Relatively positioned frames becomes a container for child // frames that are positioned @@ -12492,7 +12492,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, blockFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); } MoveChildrenTo(aPresContext, blockSC, blockFrame, list2); @@ -12514,7 +12514,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, if (aIsPositioned) { // Relatively positioned frames need a view nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame, - aStyleContext, PR_FALSE); + aStyleContext, nsnull, PR_FALSE); } if (list3) { diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 5df4dd8f32d..0d1c2a1dcf3 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -317,7 +317,7 @@ nsBoxFrame::Init(nsIPresContext* aPresContext, GetView(aPresContext, &view); if (!view) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE); GetView(aPresContext, &view); } diff --git a/layout/xul/base/src/nsDeckFrame.cpp b/layout/xul/base/src/nsDeckFrame.cpp index 06e7977281f..28745e0c79b 100644 --- a/layout/xul/base/src/nsDeckFrame.cpp +++ b/layout/xul/base/src/nsDeckFrame.cpp @@ -104,7 +104,7 @@ nsDeckFrame::CreateWidget(nsIPresContext* aPresContext, nsIBox* aBox) if (!view) { nsCOMPtr context; frame->GetStyleContext(getter_AddRefs(context)); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,frame,context,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext,frame,context,nsnull,PR_TRUE); frame->GetView(aPresContext, &view); } diff --git a/layout/xul/base/src/nsLeafBoxFrame.cpp b/layout/xul/base/src/nsLeafBoxFrame.cpp index 18c3cc75b24..45d30ad3a6c 100644 --- a/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -100,7 +100,7 @@ nsLeafBoxFrame::Init(nsIPresContext* aPresContext, GetView(aPresContext, &view); if (!view) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE); GetView(aPresContext, &view); } diff --git a/layout/xul/base/src/nsScrollBoxFrame.cpp b/layout/xul/base/src/nsScrollBoxFrame.cpp index 9dfe1f25809..a9eec4f9cde 100644 --- a/layout/xul/base/src/nsScrollBoxFrame.cpp +++ b/layout/xul/base/src/nsScrollBoxFrame.cpp @@ -128,7 +128,7 @@ nsScrollBoxFrame::SetUpScrolledFrame(nsIPresContext* aPresContext) nsCOMPtr context; frame->GetStyleContext(getter_AddRefs(context)); nsHTMLContainerFrame::CreateViewForFrame(aPresContext, frame, - context, PR_TRUE); + context, nsnull, PR_TRUE); // We need to allow the view's position to be different than the // frame's position diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp index cd63fe79d82..d91130bd483 100644 --- a/layout/xul/base/src/nsSplitterFrame.cpp +++ b/layout/xul/base/src/nsSplitterFrame.cpp @@ -361,7 +361,7 @@ nsSplitterFrame::Init(nsIPresContext* aPresContext, // XXX Hack because we need the pres context in some of the event handling functions... mPresContext = aPresContext; - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,aContext,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,aContext,nsnull,PR_TRUE); nsIView* view; GetView(aPresContext, &view);