From 132be7a8bd37b0b34ced2df42d95fb52eec61f9b Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Wed, 4 Sep 2002 04:00:41 +0000 Subject: [PATCH] bug 137388 - Jery Tan's patch to restrict applying CalcQuirkContainingBlockHeight to a frame inside a table cell. sr=bzbarsky, r=karnaze. --- layout/generic/nsHTMLReflowState.cpp | 9 +++++++-- layout/html/base/src/nsHTMLReflowState.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index fcb9e4259648..c0577cdea1d4 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -1718,13 +1718,13 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, // See if the containing block height is based on the size of its // content + nsCOMPtr fType; if (NS_AUTOHEIGHT == aContainingBlockHeight) { // See if the containing block is (1) a scrolled frame, i.e. its // parent is a scroll frame. The presence of the intervening // frame (that the scroll frame scrolls) needs to be hidden from // the containingBlockHeight calcuation, or (2) a cell frame which needs // to use the mComputedHeight of the cell instead of what the cell block passed in. - nsCOMPtr fType; if (cbrs->parentReflowState) { nsIFrame* f = cbrs->parentReflowState->frame; f->GetFrameType(getter_AddRefs(fType)); @@ -1800,7 +1800,12 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, aPresContext->GetCompatibilityMode(&mode); // in quirks mode, get the cb height using the special quirk method if (eCompatibility_NavQuirks == mode) { - aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs, PR_FALSE); + if (!IS_TABLE_CELL(fType)) { + aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs, PR_FALSE); + } + else { + heightUnit = eStyleUnit_Auto; + } // NOTE: since here we really do NEED the computed height of the containing block, // we pass PR_FALSE for the aRestrictToFirstLevel argument, allowing the method // to walk up the frame tree arbitrarily far to find a real height. This is NOT diff --git a/layout/html/base/src/nsHTMLReflowState.cpp b/layout/html/base/src/nsHTMLReflowState.cpp index fcb9e4259648..c0577cdea1d4 100644 --- a/layout/html/base/src/nsHTMLReflowState.cpp +++ b/layout/html/base/src/nsHTMLReflowState.cpp @@ -1718,13 +1718,13 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, // See if the containing block height is based on the size of its // content + nsCOMPtr fType; if (NS_AUTOHEIGHT == aContainingBlockHeight) { // See if the containing block is (1) a scrolled frame, i.e. its // parent is a scroll frame. The presence of the intervening // frame (that the scroll frame scrolls) needs to be hidden from // the containingBlockHeight calcuation, or (2) a cell frame which needs // to use the mComputedHeight of the cell instead of what the cell block passed in. - nsCOMPtr fType; if (cbrs->parentReflowState) { nsIFrame* f = cbrs->parentReflowState->frame; f->GetFrameType(getter_AddRefs(fType)); @@ -1800,7 +1800,12 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, aPresContext->GetCompatibilityMode(&mode); // in quirks mode, get the cb height using the special quirk method if (eCompatibility_NavQuirks == mode) { - aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs, PR_FALSE); + if (!IS_TABLE_CELL(fType)) { + aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs, PR_FALSE); + } + else { + heightUnit = eStyleUnit_Auto; + } // NOTE: since here we really do NEED the computed height of the containing block, // we pass PR_FALSE for the aRestrictToFirstLevel argument, allowing the method // to walk up the frame tree arbitrarily far to find a real height. This is NOT