Bug 243519. Rework root element frame construction and the CanvasFrame so that the CanvasFrame is an abs-pos container and the root element frame can be positioned. r=fantasai,sr=dbaron

This commit is contained in:
Robert O'Callahan
2008-09-06 21:35:05 +12:00
parent ea438e03d9
commit 296840fa17
48 changed files with 769 additions and 367 deletions

View File

@@ -1531,25 +1531,7 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsPresContext* aPres
// If the ancestor is block-level, the containing block is formed by the
// padding edge of the ancestor
aContainingBlockWidth += aContainingBlockRS->mComputedPadding.LeftRight();
// If the containing block is the initial containing block and it has a
// height that depends on its content, then use the viewport height instead.
// This gives us a reasonable value against which to compute percentage
// based heights and to do bottom relative positioning
if ((NS_AUTOHEIGHT == aContainingBlockHeight) &&
nsLayoutUtils::IsInitialContainingBlock(aContainingBlockRS->frame)) {
// Use the viewport height as the containing block height
const nsHTMLReflowState* rs = aContainingBlockRS->parentReflowState;
while (rs) {
aContainingBlockHeight = rs->mComputedHeight;
rs = rs->parentReflowState;
}
} else {
aContainingBlockHeight +=
aContainingBlockRS->mComputedPadding.TopBottom();
}
aContainingBlockHeight += aContainingBlockRS->mComputedPadding.TopBottom();
}
} else {
// an element in quirks mode gets a containing block based on looking for a