Bug 1440215 - TSFTextStore::FlushPendingActions() doesn't dispatch eSetSelection event r=m_kato

Although we haven't any bug reports caused by this, this is a really old bug.

When we implement TSFTextStore, we decided to use queue of dispatching
events and flush it when document lock is unlocked.  When we implement the
queue, we got this regression.

When TSFTextStore::SetText() is called with different range from current
selection range, TSFTextStore::SetSelectionInternal() add
PendingAction::SET_SELECTION into the queue first for replacing existing
text or inserting text into different position if there is no composition.
Then, TSFTextStore::InsertTextAtSelectionInternal() inserts text at the new
selection range.

When TSFTextStore::FlushPendingActions() is called after that, eSetSelection
should be dispatched and then, new text is inserted wit a set of composition
events.  However, we forgot to dispatch creating eSetSelection event.

So, this patch just dispatches the event.

MozReview-Commit-ID: Hw8FTB1R5kR

--HG--
extra : rebase_source : 8a119f1f48b167d9423fc89ce0efc722313c3732
This commit is contained in:
Masayuki Nakano 2018-02-22 15:30:58 +09:00
Родитель 48cdc06b65
Коммит 60854caf9b
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -2416,6 +2416,13 @@ TSFTextStore::FlushPendingActions()
selectionSet.mLength =
static_cast<uint32_t>(action.mSelectionLength);
selectionSet.mReversed = action.mSelectionReversed;
DispatchEvent(selectionSet);
if (!selectionSet.mSucceeded) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::FlushPendingActions() "
"FAILED due to eSetSelection failure", this));
break;
}
break;
}
default: