зеркало из https://github.com/mozilla/pjs.git
Bug 749658 - Distinguish scrollable from visual bounds for nsTextBoxFrame. r=roc
This commit is contained in:
Родитель
f9f1bdceb5
Коммит
7de5a027f9
|
@ -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);
|
|
||||||
nsOverflowAreas overflow(bounds, bounds);
|
|
||||||
|
|
||||||
if (textStyle->mTextShadow) {
|
|
||||||
// Our scrollable overflow is our bounds; our visual overflow may
|
// Our scrollable overflow is our bounds; our visual overflow may
|
||||||
// extend beyond that.
|
// extend beyond that.
|
||||||
|
nsRect visualBounds;
|
||||||
|
visualBounds.UnionRect(scrollBounds, textRect);
|
||||||
|
nsOverflowAreas overflow(visualBounds, scrollBounds);
|
||||||
|
|
||||||
|
if (textStyle->mTextShadow) {
|
||||||
|
// text-shadow extends our visual but not scrollable bounds
|
||||||
nsRect &vis = overflow.VisualOverflow();
|
nsRect &vis = overflow.VisualOverflow();
|
||||||
vis.UnionRect(vis, nsLayoutUtils::GetTextShadowRectsUnion(mTextDrawRect, this));
|
vis.UnionRect(vis, nsLayoutUtils::GetTextShadowRectsUnion(mTextDrawRect, this));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче