Only calc a quirk containing block if we have a percentage height. Bug 222730,

r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2003-10-18 05:09:42 +00:00
Родитель bde936f884
Коммит 2cb729ce47
2 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -1570,12 +1570,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
if (NS_UNCONSTRAINEDSIZE == availableWidth) {
aContainingBlockWidth = NS_UNCONSTRAINEDSIZE;
}
// an element in quirks mode gets a containing block based on the viewport (less
// body margins, border, padding) if the element is a child of the body.
// an element in quirks mode gets a containing block based on looking for a
// parent with a non-auto height if the element has a percent height
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_NavQuirks == mode) {
if (eCompatibility_NavQuirks == mode &&
mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) {
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS, PR_TRUE);
// NOTE: passing PR_TRUE for the aRestrictToFirstLevel argument, to restrict the search
// for the containing block height to only the immediate parent block or area

Просмотреть файл

@ -1570,12 +1570,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
if (NS_UNCONSTRAINEDSIZE == availableWidth) {
aContainingBlockWidth = NS_UNCONSTRAINEDSIZE;
}
// an element in quirks mode gets a containing block based on the viewport (less
// body margins, border, padding) if the element is a child of the body.
// an element in quirks mode gets a containing block based on looking for a
// parent with a non-auto height if the element has a percent height
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_NavQuirks == mode) {
if (eCompatibility_NavQuirks == mode &&
mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) {
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS, PR_TRUE);
// NOTE: passing PR_TRUE for the aRestrictToFirstLevel argument, to restrict the search
// for the containing block height to only the immediate parent block or area