Merge the latest green PGO changeset from mozilla-inbound to mozilla-central

This commit is contained in:
Ehsan Akhgari 2012-04-30 10:58:35 -04:00
commit 0c839552d3

View File

@ -931,13 +931,14 @@ nsTextBoxFrame::DoLayout(nsBoxLayoutState& aBoxLayoutState)
const nsStyleText* textStyle = GetStyleText(); const nsStyleText* textStyle = GetStyleText();
nsRect bounds(nsPoint(0, 0), GetSize()); nsRect scrollBounds(nsPoint(0, 0), GetSize());
nsRect textRect = mTextDrawRect; nsRect textRect = mTextDrawRect;
nsRefPtr<nsFontMetrics> fontMet; nsRefPtr<nsFontMetrics> fontMet;
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)); nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet));
nsBoundingMetrics metrics = nsBoundingMetrics metrics =
fontMet->GetInkBoundsForVisualOverflow(mTitle.get(), mTitle.Length(), fontMet->GetInkBoundsForVisualOverflow(mCroppedTitle.get(),
mCroppedTitle.Length(),
aBoxLayoutState.GetRenderingContext()); aBoxLayoutState.GetRenderingContext());
textRect.x -= metrics.leftBearing; textRect.x -= metrics.leftBearing;
@ -946,12 +947,14 @@ nsTextBoxFrame::DoLayout(nsBoxLayoutState& aBoxLayoutState)
textRect.y += fontMet->MaxAscent() - metrics.ascent; textRect.y += fontMet->MaxAscent() - metrics.ascent;
textRect.height = metrics.ascent + metrics.descent; textRect.height = metrics.ascent + metrics.descent;
bounds.UnionRect(bounds, textRect); // Our scrollable overflow is our bounds; our visual overflow may
nsOverflowAreas overflow(bounds, bounds); // extend beyond that.
nsRect visualBounds;
visualBounds.UnionRect(scrollBounds, textRect);
nsOverflowAreas overflow(visualBounds, scrollBounds);
if (textStyle->mTextShadow) { if (textStyle->mTextShadow) {
// Our scrollable overflow is our bounds; our visual overflow may // text-shadow extends our visual but not scrollable bounds
// extend beyond that.
nsRect &vis = overflow.VisualOverflow(); nsRect &vis = overflow.VisualOverflow();
vis.UnionRect(vis, nsLayoutUtils::GetTextShadowRectsUnion(mTextDrawRect, this)); vis.UnionRect(vis, nsLayoutUtils::GetTextShadowRectsUnion(mTextDrawRect, this));
} }