diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 8f89eaffdc2..e4e1aa8b38a 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -120,6 +120,18 @@ nsBulletFrame::GetType() const return nsGkAtoms::bulletFrame; } +PRBool +nsBulletFrame::IsEmpty() +{ + return IsSelfEmpty(); +} + +PRBool +nsBulletFrame::IsSelfEmpty() +{ + return GetStyleList()->mListStyleType == NS_STYLE_LIST_STYLE_NONE; +} + NS_IMETHODIMP nsBulletFrame::DidSetStyleContext() { diff --git a/mozilla/layout/generic/nsBulletFrame.h b/mozilla/layout/generic/nsBulletFrame.h index 19f4dce1b8f..42e16faf514 100644 --- a/mozilla/layout/generic/nsBulletFrame.h +++ b/mozilla/layout/generic/nsBulletFrame.h @@ -101,6 +101,9 @@ public: void PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt, const nsRect& aDirtyRect); + + virtual PRBool IsEmpty(); + virtual PRBool IsSelfEmpty(); protected: void GetDesiredSize(nsPresContext* aPresContext, diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index 107ea824631..811508b44d7 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -868,10 +868,12 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // the float. At the same time, check if the frame has any non-collapsed-away // content. PRBool placedFloat = PR_FALSE; - PRBool hasNoncollapsedContent = PR_TRUE; - if (frameType) { + PRBool isEmpty; + if (!frameType) { + isEmpty = pfd->mFrame->IsEmpty(); + } else { if (nsGkAtoms::placeholderFrame == frameType) { - hasNoncollapsedContent = PR_FALSE; + isEmpty = PR_TRUE; pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE); nsIFrame* outOfFlowFrame = nsLayoutUtils::GetFloatFromPlaceholder(aFrame); if (outOfFlowFrame) { @@ -893,9 +895,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // Note non-empty text-frames for inline frame compatibility hackery pfd->SetFlag(PFD_ISTEXTFRAME, PR_TRUE); nsTextFrame* textFrame = static_cast(pfd->mFrame); - if (!textFrame->HasNoncollapsedCharacters()) { - hasNoncollapsedContent = PR_FALSE; - } else { + isEmpty = !textFrame->HasNoncollapsedCharacters(); + if (!isEmpty) { pfd->SetFlag(PFD_ISNONEMPTYTEXTFRAME, PR_TRUE); nsIContent* content = textFrame->GetContent(); @@ -924,13 +925,15 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, } else if (nsGkAtoms::brFrame == frameType) { pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE); + isEmpty = PR_FALSE; } else { if (nsGkAtoms::letterFrame==frameType) { pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE); } - if (pfd->mSpan && - !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty()) { - hasNoncollapsedContent = PR_FALSE; + if (pfd->mSpan) { + isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty(); + } else { + isEmpty = pfd->mFrame->IsEmpty(); } } } @@ -1012,7 +1015,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, if (CanPlaceFrame(pfd, reflowState, notSafeToBreak, continuingTextRun, savedOptionalBreakContent != nsnull, metrics, aReflowStatus, &optionalBreakAfterFits)) { - if (hasNoncollapsedContent) { + if (!isEmpty) { psd->mHasNonemptyContent = PR_TRUE; } diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index 9f77f8c3255..25310f13f00 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -752,6 +752,6 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 419531-1.html 419531-1-ref.html == 420069-1.html 420069-1-ref.html == 420069-2.html 420069-2-ref.html -# == 420351-1.html 420351-1-ref.html +== 420351-1.html 420351-1-ref.html == 421234-1.html 421234-1-ref.html == 421419-1.html 421419-1-ref.html