Bug 421353 - "Moving the mouse over text hyperlinks which become underlined spikes cpu usage" (Fix incorrect use of units in previous patch) [p=reg@openpave.org (Jeremy Lea) r+sr=roc a1.9=beltzner]

This commit is contained in:
reed@reedloden.com 2008-04-04 02:19:02 -07:00
parent a661ad514e
commit ae07446635

View File

@ -4929,16 +4929,6 @@ FindFirstLetterRange(const nsTextFragment* aFrag,
return PR_TRUE;
}
static nsRect ConvertGfxRectOutward(const gfxRect& aRect)
{
nsRect r;
r.x = NSToCoordFloor(aRect.X());
r.y = NSToCoordFloor(aRect.Y());
r.width = NSToCoordCeil(aRect.XMost()) - r.x;
r.height = NSToCoordCeil(aRect.YMost()) - r.y;
return r;
}
static PRUint32
FindStartAfterSkippingWhitespace(PropertyProvider* aProvider,
nsIFrame::InlineIntrinsicWidthData* aData,
@ -5587,8 +5577,7 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
mAscent = aMetrics.ascent;
// Handle text that runs outside its normal bounds.
nsRect boundingBox =
ConvertGfxRectOutward(textMetrics.mBoundingBox + gfxPoint(0, mAscent));
nsRect boundingBox = RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent);
aMetrics.mOverflowArea.UnionRect(boundingBox,
nsRect(0, 0, aMetrics.width, aMetrics.height));
@ -5812,8 +5801,7 @@ nsTextFrame::RecomputeOverflowRect()
ComputeTransformedLength(provider), PR_FALSE, nsnull,
&provider);
nsRect boundingBox =
ConvertGfxRectOutward(textMetrics.mBoundingBox + gfxPoint(0, mAscent));
nsRect boundingBox = RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent);
boundingBox.UnionRect(boundingBox,
nsRect(nsPoint(0,0), GetSize()));