Changed the setting of PrimaryFrame for elements wrapped in a GfxScrollFrame,

except for the DocElement which still has the primary frame set to the scrolledframe.
Fixed compiler warning around NS_NewFiedlSetFrame(...).
r=evaughan b=23803


git-svn-id: svn://10.0.0.236/trunk@59248 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
attinasi%netscape.com
2000-01-31 14:04:41 +00:00
parent 010367b83d
commit 7f83027391
2 changed files with 24 additions and 12 deletions

View File

@@ -2299,8 +2299,9 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
aParentFrame,
contentFrame,
styleContext);
aNewFrame = scrollFrame;
// primary is set above (to the contentFrame)
aNewFrame = scrollFrame;
} else {
// if not scrollable the new frame is the content frame.
aNewFrame = contentFrame;
@@ -2605,6 +2606,9 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
parentFrame,
rootFrame,
rootPseudoStyle);
// set the primary frame to the root frame
state.mFrameManager->SetPrimaryFrameFor(aDocElement, rootFrame);
}
if (isPaginated) {
@@ -3307,7 +3311,9 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShell,
nsIFrame * newFrame;
PRUint32 flags = aIsAbsolutelyPositioned ? NS_BLOCK_SPACE_MGR : 0;
nsresult rv = NS_NewFieldSetFrame(aPresShell, &newFrame, flags);
if (!NS_SUCCEEDED(rv) {
return rv;
}
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));
@@ -4500,9 +4506,6 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIPresContext* aPresConte
// the the scroll frames child list
aScrollFrame->SetInitialChildList(aPresContext, nsnull, aScrolledFrame);
if (aContent != nsnull)
aState.mFrameManager->SetPrimaryFrameFor(aContent, aScrolledFrame);
return NS_OK;
}
@@ -4599,6 +4602,9 @@ nsCSSFrameConstructor::BuildScrollFrame (nsIPresShell* aPresShell,
aScrolledContentStyle = scrolledContentStyle;
// now set the primary frame to the ScrollFrame
aState.mFrameManager->SetPrimaryFrameFor( aContent, aNewFrame );
return NS_OK;
}