Bug 1134744 - Fix baseline for form controls when line is inverted relative to block dir. r=smontagu

This commit is contained in:
Jonathan Kew 2015-03-03 12:25:17 +00:00
Родитель e673083ef6
Коммит 4c781f24a6
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -70,9 +70,13 @@ nsFormControlFrame::GetLogicalBaseline(WritingMode aWritingMode) const
NS_ASSERTION(!NS_SUBTREE_DIRTY(this), NS_ASSERTION(!NS_SUBTREE_DIRTY(this),
"frame must not be dirty"); "frame must not be dirty");
// Treat radio buttons and checkboxes as having an intrinsic baseline // Treat radio buttons and checkboxes as having an intrinsic baseline
// at the bottom of the control (use the bottom content edge rather // at the block-end of the control (use the block-end content edge rather
// than the bottom margin edge). // than the margin edge).
return BSize(aWritingMode) - // For "inverted" lines (typically in writing-mode:vertical-lr), use the
// block-start end instead.
return aWritingMode.IsLineInverted()
? GetLogicalUsedBorderAndPadding(aWritingMode).BStart(aWritingMode)
: BSize(aWritingMode) -
GetLogicalUsedBorderAndPadding(aWritingMode).BEnd(aWritingMode); GetLogicalUsedBorderAndPadding(aWritingMode).BEnd(aWritingMode);
} }