Bug 851514. Make sure that we add the parent frame before its kids when constructing a scrollable block, so that things will appear in the right order in fixed-pos lists. r=dbaron

This commit is contained in:
Boris Zbarsky
2013-05-21 14:15:30 -04:00
parent 828f3764fb
commit 08bf84cf6a
5 changed files with 110 additions and 1 deletions

View File

@@ -4364,6 +4364,10 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState,
nsIFrame* scrolledFrame =
NS_NewBlockFormattingContext(mPresShell, styleContext);
// Make sure to AddChild before we call ConstructBlock so that we
// end up before our descendants in fixed-pos lists as needed.
aState.AddChild(newFrame, aFrameItems, content, styleContext, aParentFrame);
nsFrameItems blockItem;
ConstructBlock(aState, scrolledContentStyle->StyleDisplay(), content,
newFrame, newFrame, scrolledContentStyle,
@@ -4375,7 +4379,6 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState,
"Scrollframe's frameItems should be exactly the scrolled frame");
FinishBuildingScrollFrame(newFrame, scrolledFrame);
aState.AddChild(newFrame, aFrameItems, content, styleContext, aParentFrame);
return newFrame;
}