Bug 1097499 part 6 - Inherit move direction from parent for horizontal-in-vertical text. r=jfkthame

MozReview-Commit-ID: 28mBKQnYydp

--HG--
extra : source : cf2271efff54b97ccbf30a73c903d577fca72dab
This commit is contained in:
Xidorn Quan 2016-04-22 09:18:41 +10:00
parent 79d3a9f880
commit 752571191a

View File

@ -2126,7 +2126,17 @@ nsFrameSelection::PhysicalMove(int16_t aDirection, int16_t aAmount,
if (NS_SUCCEEDED(sel->GetPrimaryFrameForFocusNode(&frame, &offsetused,
true))) {
if (frame) {
wm = frame->GetWritingMode();
if (!frame->StyleContext()->IsTextCombined()) {
wm = frame->GetWritingMode();
} else {
// Using different direction for horizontal-in-vertical would
// make it hard to navigate via keyboard. Inherit the moving
// direction from its parent.
MOZ_ASSERT(frame->GetType() == nsGkAtoms::textFrame);
wm = frame->GetParent()->GetWritingMode();
MOZ_ASSERT(wm.IsVertical(), "Text combined "
"can only appear in vertical text");
}
}
}