mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
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
This commit is contained in:
parent
b1eb24a0ce
commit
111ba4ec67
@ -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;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user