Bug 349259 patch 2: Prevent html:input elements from having a line-height smaller than 1. r=bz

This commit is contained in:
L. David Baron 2014-03-12 20:33:21 -07:00
parent 2d1064d968
commit 9a38e7f2eb

View File

@ -2485,6 +2485,16 @@ nsHTMLReflowState::CalcLineHeight(nsIContent* aContent,
NS_ASSERTION(lineHeight >= 0, "ComputeLineHeight screwed up");
if (aContent && aContent->IsHTML(nsGkAtoms::input)) {
// For Web-compatibility, input elements cannot have a line-height
// smaller than one.
nscoord lineHeightOne =
aFontSizeInflation * aStyleContext->StyleFont()->mFont.size;
if (lineHeight < lineHeightOne) {
lineHeight = lineHeightOne;
}
}
return lineHeight;
}