From 4c781f24a6428d9c2272baa149c287d35b5e49c1 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Tue, 3 Mar 2015 12:25:17 +0000 Subject: [PATCH] Bug 1134744 - Fix baseline for form controls when line is inverted relative to block dir. r=smontagu --- layout/forms/nsFormControlFrame.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 2e42ccdaaa66..4abc71f7120a 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -70,9 +70,13 @@ nsFormControlFrame::GetLogicalBaseline(WritingMode aWritingMode) const NS_ASSERTION(!NS_SUBTREE_DIRTY(this), "frame must not be dirty"); // Treat radio buttons and checkboxes as having an intrinsic baseline - // at the bottom of the control (use the bottom content edge rather - // than the bottom margin edge). - return BSize(aWritingMode) - + // at the block-end of the control (use the block-end content edge rather + // than the margin edge). + // 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); }