Bug 429968. Handle situations where first-letter text detects first-letter style should not be applied, by creating a zero-length 'first letter'. patch by roc, r+sr=dbaron, a=dveditz

git-svn-id: svn://10.0.0.236/trunk@257209 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dveditz%cruzio.com
2009-05-16 19:37:37 +00:00
parent e52f9bb32d
commit e26895f495
11 changed files with 124 additions and 9 deletions

View File

@@ -224,23 +224,25 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
ll.BeginLineReflow(bp.left, bp.top, availSize.width, NS_UNCONSTRAINEDSIZE,
PR_FALSE, PR_TRUE);
rs.mLineLayout = ≪
ll.SetInFirstLetter(PR_TRUE);
ll.SetFirstLetterStyleOK(PR_TRUE);
kid->WillReflow(aPresContext);
kid->Reflow(aPresContext, aMetrics, rs, aReflowStatus);
ll.EndLineReflow();
ll.SetInFirstLetter(PR_FALSE);
}
else {
// Pretend we are a span and reflow the child frame
nsLineLayout* ll = aReflowState.mLineLayout;
PRBool pushedFrame;
NS_ASSERTION(ll->GetFirstLetterStyleOK() || GetPrevInFlow(),
"First-in-flow first-letter should have first-letter style enabled in nsLineLayout!");
ll->SetInFirstLetter(GetPrevContinuation() == nsnull);
ll->BeginSpan(this, &aReflowState, bp.left, availSize.width);
ll->ReflowFrame(kid, aReflowStatus, &aMetrics, pushedFrame);
ll->EndSpan(this);
ll->SetInFirstLetter(PR_FALSE);
}
// Place and size the child and update the output metrics