Bug 492469. Better handling of end margins/borders/padding for frames that end up complete while having both fluid and fixed continuations. r+sr=dbaron

This commit is contained in:
Boris Zbarsky 2009-05-13 12:38:58 -04:00
parent f0edf9570f
commit 30f1a769f0
2 changed files with 7 additions and 10 deletions

View File

@ -575,13 +575,10 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
* We want to only apply the end border and padding if we're the last
* continuation and not in the first part of an {ib} split. To be the last
* continuation we have to be complete (so that we won't get a next-in-flow)
* and have no non-fluid continuations.
*
* FIXME the check for non-fluid continuations is not quite correct in the
* code (though the comment above describes it correctly); see bug 492469.
* and have no non-fluid continuations on our continuation chain.
*/
if (NS_FRAME_IS_COMPLETE(aStatus) &&
(!GetNextContinuation() || GetNextInFlow()) &&
!GetLastInFlow()->GetNextContinuation() &&
!nsLayoutUtils::FrameIsInFirstPartOfIBSplit(this)) {
aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.right
: aReflowState.mComputedBorderPadding.left;

View File

@ -1166,16 +1166,16 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
* not in the first part of an {ib} split. In all other cases we want to
* zero it out. That means zeroing it out if any of these conditions hold:
* 1) The frame is not complete (in this case it will get a next-in-flow)
* 2) The frame is complete but has a non-fluid continuation. Note that if
* it has a fluid continuation, that continuation will get destroyed
* later, so we don't want to drop the end-margin in that case.
* // FIXME: bug 492469
* 2) The frame is complete but has a non-fluid continuation on its
* continuation chain. Note that if it has a fluid continuation, that
* continuation will get destroyed later, so we don't want to drop the
* end-margin in that case.
* 3) The frame is in the first part of an {ib} split.
*
* However, none of that applies if this is a letter frame (XXXbz why?)
*/
if ((NS_FRAME_IS_NOT_COMPLETE(aStatus) ||
(pfd->mFrame->GetNextContinuation() && !pfd->mFrame->GetNextInFlow()) ||
pfd->mFrame->GetLastInFlow()->GetNextContinuation() ||
nsLayoutUtils::FrameIsInFirstPartOfIBSplit(pfd->mFrame))
&& !pfd->GetFlag(PFD_ISLETTERFRAME)) {
if (ltr)