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