From 8e9ce2be93c2f1c4fd5d75eefc6e809ee29df582 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Tue, 6 Nov 2001 22:57:17 +0000 Subject: [PATCH] bug 30692 - Have children of cell block use the computed width of the cell. sr=attinasi, r=alexsavulov git-svn-id: svn://10.0.0.236/trunk@107490 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLReflowState.cpp | 15 ++++++++++++--- .../layout/html/base/src/nsHTMLReflowState.cpp | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 1f1cd6aab4b..a7d1297df7c 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -1620,19 +1620,28 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, // See if the containing block height is based on the size of its // content if (NS_AUTOHEIGHT == aContainingBlockHeight) { - // See if the containing block is a scrolled frame, i.e. its + // 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. + // 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; - nsCOMPtr fType; f->GetFrameType(getter_AddRefs(fType)); if (nsLayoutAtoms::scrollFrame == fType.get()) { // Use the scroll frame's computed height instead aContainingBlockHeight = ((nsHTMLReflowState*)cbrs->parentReflowState)->mComputedHeight; } + else { + cbrs->frame->GetFrameType(getter_AddRefs(fType)); + if (nsLayoutAtoms::tableCellFrame == fType.get()) { + // use the cell's computed height + aContainingBlockHeight = + ((nsHTMLReflowState*)cbrs)->mComputedHeight; + } + } } } diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index 1f1cd6aab4b..a7d1297df7c 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -1620,19 +1620,28 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext, // See if the containing block height is based on the size of its // content if (NS_AUTOHEIGHT == aContainingBlockHeight) { - // See if the containing block is a scrolled frame, i.e. its + // 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. + // 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; - nsCOMPtr fType; f->GetFrameType(getter_AddRefs(fType)); if (nsLayoutAtoms::scrollFrame == fType.get()) { // Use the scroll frame's computed height instead aContainingBlockHeight = ((nsHTMLReflowState*)cbrs->parentReflowState)->mComputedHeight; } + else { + cbrs->frame->GetFrameType(getter_AddRefs(fType)); + if (nsLayoutAtoms::tableCellFrame == fType.get()) { + // use the cell's computed height + aContainingBlockHeight = + ((nsHTMLReflowState*)cbrs)->mComputedHeight; + } + } } }