Bug 1166436 part.5 mContentCache should store writing mode at selection and TabParent should use it r=m_kato

This commit is contained in:
Masayuki Nakano
2015-06-05 18:28:19 +09:00
parent 5652a197fc
commit bf5c5fd587
4 changed files with 30 additions and 15 deletions

View File

@@ -38,10 +38,13 @@ ContentCache::SetText(const nsAString& aText)
}
void
ContentCache::SetSelection(uint32_t aAnchorOffset, uint32_t aFocusOffset)
ContentCache::SetSelection(uint32_t aAnchorOffset,
uint32_t aFocusOffset,
const WritingMode& aWritingMode)
{
mSelection.mAnchor = aAnchorOffset;
mSelection.mFocus = aFocusOffset;
mSelection.mWritingMode = aWritingMode;
}
bool
@@ -145,7 +148,8 @@ ContentCache::OnCompositionEvent(const WidgetCompositionEvent& aEvent)
// XXX This causes different behavior from non-e10s mode.
// Selection range should represent caret position in the composition
// string but this means selection range is all of the composition string.
SetSelection(mCompositionStart + aEvent.mData.Length());
SetSelection(mCompositionStart + aEvent.mData.Length(),
mSelection.mWritingMode);
mIsComposing = !aEvent.CausesDOMCompositionEndEvent();
return true;
}