Bug 385234. Iterate through textframe continuations properly in AddInlinePref/MinWidth. r=smontagu

This commit is contained in:
roc+@cs.cmu.edu 2007-06-21 17:14:34 -07:00
parent 63340d2891
commit 2f6a9ffa9f
2 changed files with 25 additions and 25 deletions

View File

@ -4960,18 +4960,18 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext,
nsTextFrame::AddInlineMinWidth(nsIRenderingContext *aRenderingContext,
nsIFrame::InlineMinWidthData *aData)
{
AddInlineMinWidthForFlow(aRenderingContext, aData);
if (mTextRun && !(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_SIMPLE_FLOW)) {
// mTextRun did not cover all continuations of this frame.
// Measure all additional flows associated with this frame's content.
nsTextFrame* f = this;
for (;;) {
f = NS_STATIC_CAST(nsTextFrame*, f->GetNextContinuation());
if (!f)
break;
if (f->GetStateBits() & TEXT_IS_RUN_OWNER) {
f->AddInlineMinWidthForFlow(aRenderingContext, aData);
}
nsTextFrame* f;
gfxTextRun* lastTextRun = nsnull;
// nsContinuingTextFrame does nothing for AddInlineMinWidth; all text frames
// in the flow are handled right here.
for (f = this; f; f = NS_STATIC_CAST(nsTextFrame*, f->GetNextContinuation())) {
// f->mTextRun could be null if we haven't set up textruns yet for f.
// Except in OOM situations, lastTextRun will only be null for the first
// text frame.
if (f == this || f->mTextRun != lastTextRun) {
// This will process all the text frames that share the same textrun as f.
f->AddInlineMinWidthForFlow(aRenderingContext, aData);
lastTextRun = f->mTextRun;
}
}
}
@ -5049,18 +5049,18 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
nsTextFrame::AddInlinePrefWidth(nsIRenderingContext *aRenderingContext,
nsIFrame::InlinePrefWidthData *aData)
{
AddInlinePrefWidthForFlow(aRenderingContext, aData);
if (mTextRun && !(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_SIMPLE_FLOW)) {
// mTextRun did not cover all continuations of this frame.
// Measure all additional flows associated with this frame's content.
nsTextFrame* f = this;
for (;;) {
f = NS_STATIC_CAST(nsTextFrame*, f->GetNextContinuation());
if (!f)
break;
if (f->GetStateBits() & TEXT_IS_RUN_OWNER) {
f->AddInlinePrefWidthForFlow(aRenderingContext, aData);
}
nsTextFrame* f;
gfxTextRun* lastTextRun = nsnull;
// nsContinuingTextFrame does nothing for AddInlineMinWidth; all text frames
// in the flow are handled right here.
for (f = this; f; f = NS_STATIC_CAST(nsTextFrame*, f->GetNextContinuation())) {
// f->mTextRun could be null if we haven't set up textruns yet for f.
// Except in OOM situations, lastTextRun will only be null for the first
// text frame.
if (f == this || f->mTextRun != lastTextRun) {
// This will process all the text frames that share the same textrun as f.
f->AddInlinePrefWidthForFlow(aRenderingContext, aData);
lastTextRun = f->mTextRun;
}
}
}

View File

@ -121,7 +121,7 @@ random == 328829-1.xhtml 328829-1-ref.xhtml # bug 369046 (intermittent)
== 335628-1.html 335628-1-ref.html
!= 335628-2.xul 335628-2-ref.xul
== 336147-1.html 336147-1-ref.html
fails == 336736-1.html 336736-1-ref.html # something wrong with subpixel horizontal alignment (tracked in bug 336736)
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 336736-1.html 336736-1-ref.html # something wrong with subpixel horizontal alignment (tracked in bug 336736)
== 339289-1.html 339289-1-ref.html
== 341043-1a.html 341043-1-ref.html
!= 341043-1b.html 341043-1-ref.html