Bug 1093553 - Followup to fix positioning of the caret with writing-mode:vertical-lr and text-orientation:sideways-right. r=smontagu

This commit is contained in:
Jonathan Kew 2014-11-13 08:58:06 +00:00
parent 34fea182cd
commit 5182bb2e02

View File

@ -309,9 +309,14 @@ nsCaret::GetGeometryForFrame(nsIFrame* aFrame,
descent = fm->MaxDescent();
}
nscoord height = ascent + descent;
bool vertical = aFrame->GetWritingMode().IsVertical();
WritingMode wm = aFrame->GetWritingMode();
bool vertical = wm.IsVertical();
if (vertical) {
framePos.x = baseline - ascent;
if (wm.IsLineInverted()) {
framePos.x = baseline - descent;
} else {
framePos.x = baseline - ascent;
}
} else {
framePos.y = baseline - ascent;
}