Align input type=text/radio/checkbox/button so that text is on baseline (bzbarsky's patch, bug 167236), r=jkeiser@netscape.com, sr=dbaron@fas.harvard.edu

git-svn-id: svn://10.0.0.236/trunk@130554 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jkeiser%netscape.com
2002-09-27 00:04:22 +00:00
parent b0e21eb3d2
commit d59bc1b4f8
6 changed files with 40 additions and 18 deletions

View File

@@ -2235,9 +2235,21 @@ nsTextControlFrame::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
NS_IMETHODIMP
nsTextControlFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
{
nsSize size;
nsresult rv = GetPrefSize(aState, size);
aAscent = size.height;
nsresult rv;
if (IsSingleLineTextControl()) {
// First calculate the ascent of the text inside
rv = nsStackFrame::GetAscent(aState, aAscent);
NS_ENSURE_SUCCESS(rv, rv);
// Now adjust the ascent for our borders and padding
aAscent += aState.GetReflowState()->mComputedBorderPadding.top;
} else {
// For a textarea or <editor>, just don't bother for now
nsSize size;
rv = GetPrefSize(aState, size);
aAscent = size.height;
}
return rv;
}