mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Remove check for GECKO_USE_COMPUTED_HEIGHT environment variable. b=196270 r+sr=roc a=bsmedberg
This commit is contained in:
parent
477583ba8f
commit
8271626e99
@ -2184,23 +2184,6 @@ nsHTMLReflowState::CalculateBlockSideMargins(nscoord aAvailWidth,
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHTMLReflowState::UseComputedHeight()
|
||||
{
|
||||
static PRBool useComputedHeight = PR_FALSE;
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS)
|
||||
static PRBool firstTime = 1;
|
||||
if (firstTime) {
|
||||
if (getenv("GECKO_USE_COMPUTED_HEIGHT")) {
|
||||
useComputedHeight = PR_TRUE;
|
||||
}
|
||||
firstTime = 0;
|
||||
}
|
||||
#endif
|
||||
return useComputedHeight;
|
||||
}
|
||||
|
||||
#define NORMAL_LINE_HEIGHT_FACTOR 1.2f // in term of emHeight
|
||||
// For "normal" we use the font's normal line height (em height + leading).
|
||||
// If both internal leading and external leading specified by font itself
|
||||
@ -2278,16 +2261,11 @@ ComputeLineHeight(nsPresContext* aPresContext,
|
||||
// little hack lets us override that behavior to allow for more
|
||||
// precise layout in the face of imprecise fonts.
|
||||
nscoord emHeight = font->mFont.size;
|
||||
if (!nsHTMLReflowState::UseComputedHeight()) {
|
||||
fm->GetEmHeight(emHeight);
|
||||
}
|
||||
fm->GetEmHeight(emHeight);
|
||||
lineHeight = NSToCoordRound(factor * emHeight);
|
||||
} else {
|
||||
NS_ASSERTION(eStyleUnit_Normal == unit, "bad unit");
|
||||
lineHeight = font->mFont.size;
|
||||
if (!nsHTMLReflowState::UseComputedHeight()) {
|
||||
lineHeight = GetNormalLineHeight(fm);
|
||||
}
|
||||
lineHeight = GetNormalLineHeight(fm);
|
||||
}
|
||||
}
|
||||
return lineHeight;
|
||||
|
@ -385,8 +385,6 @@ struct nsHTMLReflowState {
|
||||
nsIRenderingContext* aRenderingContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
static PRBool UseComputedHeight();
|
||||
|
||||
void InitFrameType();
|
||||
|
||||
void ComputeContainingBlockRectangle(nsPresContext* aPresContext,
|
||||
|
@ -624,18 +624,6 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
||||
aMetrics.descent += aReflowState.mComputedBorderPadding.bottom;
|
||||
aMetrics.height += aReflowState.mComputedBorderPadding.top +
|
||||
aReflowState.mComputedBorderPadding.bottom;
|
||||
|
||||
// Note: we normally use the actual font height for computing the
|
||||
// line-height raw value from the style context. On systems where
|
||||
// they disagree the actual font height is more appropriate. This
|
||||
// little hack lets us override that behavior to allow for more
|
||||
// precise layout in the face of imprecise fonts.
|
||||
if (nsHTMLReflowState::UseComputedHeight()) {
|
||||
const nsStyleFont* font = GetStyleFont();
|
||||
aMetrics.height = font->mFont.size +
|
||||
aReflowState.mComputedBorderPadding.top +
|
||||
aReflowState.mComputedBorderPadding.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
// For now our overflow area is zero. The real value will be
|
||||
|
@ -2439,13 +2439,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
nscoord minimumLineHeight = mMinLineHeight;
|
||||
nscoord fontAscent, fontHeight;
|
||||
fm->GetMaxAscent(fontAscent);
|
||||
if (nsHTMLReflowState::UseComputedHeight()) {
|
||||
fontHeight = spanFrame->GetStyleFont()->mFont.size;
|
||||
}
|
||||
else
|
||||
{
|
||||
fm->GetHeight(fontHeight);
|
||||
}
|
||||
fm->GetHeight(fontHeight);
|
||||
|
||||
nscoord leading = minimumLineHeight - fontHeight;
|
||||
nscoord yTop = -fontAscent - leading/2;
|
||||
|
Loading…
Reference in New Issue
Block a user