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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user