Bug 381703. First-letter frames that are wrapping non-first-letter-content should behave like spans and not compute their size. r+sr=dbaron

This commit is contained in:
roc+@cs.cmu.edu 2007-07-18 21:29:59 -07:00
Родитель 09b089866b
Коммит 32a3b83c42
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -78,6 +78,10 @@ public:
InlineMinWidthData *aData);
virtual void AddInlinePrefWidth(nsIRenderingContext *aRenderingContext,
InlinePrefWidthData *aData);
virtual nsSize ComputeSize(nsIRenderingContext *aRenderingContext,
nsSize aCBSize, nscoord aAvailableWidth,
nsSize aMargin, nsSize aBorder, nsSize aPadding,
PRBool aShrinkWrap);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
@ -223,6 +227,21 @@ nsFirstLetterFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
return nsLayoutUtils::PrefWidthFromInline(this, aRenderingContext);
}
/* virtual */ nsSize
nsFirstLetterFrame::ComputeSize(nsIRenderingContext *aRenderingContext,
nsSize aCBSize, nscoord aAvailableWidth,
nsSize aMargin, nsSize aBorder, nsSize aPadding,
PRBool aShrinkWrap)
{
if (GetPrevInFlow()) {
// We're wrapping the text *after* the first letter, so behave like an
// inline frame.
return nsSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
}
return nsFirstLetterFrameSuper::ComputeSize(aRenderingContext,
aCBSize, aAvailableWidth, aMargin, aBorder, aPadding, aShrinkWrap);
}
NS_IMETHODIMP
nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics,