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:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user