Make sure to not rely on how scrollframes handle frame offsets (esp. since it's

changed) when positioning fixed-pos frames.  Bug 331729, r+sr=roc


git-svn-id: svn://10.0.0.236/trunk@193567 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2006-04-04 22:36:01 +00:00
parent 8e865ab1f1
commit 84ef11c140

View File

@@ -1002,12 +1002,18 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext,
if (mStyleDisplay->mPosition == NS_STYLE_POSITION_FIXED) {
// In this case, cbrs->frame will always be an ancestor of
// aContainingBlock, so can just walk our way up the frame tree.
// Make sure to not add positions of frames whose parent is a
// scrollFrame, since we're doing fixed positioning, which assumes
// everything is scrolled to (0,0).
cbOffset.MoveTo(0, 0);
do {
cbOffset += aContainingBlock->GetPosition();
nsPoint curOffset = aContainingBlock->GetPosition();
aContainingBlock = aContainingBlock->GetParent();
NS_ASSERTION(aContainingBlock,
"Should hit cbrs->frame before we run off the frame tree!");
if (aContainingBlock->GetType() != nsLayoutAtoms::scrollFrame) {
cbOffset += curOffset;
}
} while (aContainingBlock != cbrs->frame);
} else {
cbOffset = aContainingBlock->GetOffsetTo(cbrs->frame);