--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -1186,17 +1186,17 @@ TSFTextStore::TSFTextStore()
, mHandlingKeyMessage(0)
, mContentForTSF(mComposition, mSelection)
, mRequestedAttrValues(false)
, mIsRecordingActionsWithoutLock(false)
, mPendingOnSelectionChange(false)
, mHasReturnedNoLayoutError(false)
, mWaitingQueryLayout(false)
, mPendingDestroy(false)
- , mDeferClearingLockedContent(false)
+ , mDeferClearingContentForTSF(false)
, mNativeCaretIsCreated(false)
, mDeferNotifyingTSF(false)
, mDeferCommittingComposition(false)
, mDeferCancellingComposition(false)
, mDestroyed(false)
, mBeingDestroyed(false)
{
for (int32_t i = 0; i < NUM_OF_SUPPORTED_ATTRS; i++) {
@@ -1660,29 +1660,29 @@ TSFTextStore::FlushPendingActions()
"FAILED due to eSetSelection failure", this));
break;
}
}
// eCompositionStart always causes
// NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED. Therefore, we should
// wait to clear the locked content until it's notified.
- mDeferClearingLockedContent = true;
+ mDeferClearingContentForTSF = true;
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"dispatching compositionstart event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->StartComposition(status, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"FAILED to dispatch compositionstart event.", this));
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
}
if (!mWidget || mWidget->Destroyed()) {
break;
}
break;
}
case PendingAction::COMPOSITION_UPDATE: {
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
@@ -1691,65 +1691,65 @@ TSFTextStore::FlushPendingActions()
"mRanges=0x%p, mRanges->Length()=%d }",
this, NS_ConvertUTF16toUTF8(action.mData).get(), action.mRanges.get(),
action.mRanges ? action.mRanges->Length() : 0));
// eCompositionChange causes a DOM text event, the IME will be notified
// of NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED. In this case, we
// should not clear the locked content until we notify the IME of the
// composition update.
- mDeferClearingLockedContent = true;
+ mDeferClearingContentForTSF = true;
rv = mDispatcher->SetPendingComposition(action.mData,
action.mRanges);
if (NS_WARN_IF(NS_FAILED(rv))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"FAILED to setting pending composition...", this));
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
} else {
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"dispatching compositionchange event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->FlushPendingComposition(status, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"FAILED to dispatch compositionchange event.", this));
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
}
// Be aware, the mWidget might already have been destroyed.
}
break;
}
case PendingAction::COMPOSITION_END: {
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"flushing COMPOSITION_END={ mData=\"%s\" }",
this, NS_ConvertUTF16toUTF8(action.mData).get()));
// Dispatching eCompositionCommit causes a DOM text event, then,
// the IME will be notified of NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
// In this case, we should not clear the locked content until we notify
// the IME of the composition update.
- mDeferClearingLockedContent = true;
+ mDeferClearingContentForTSF = true;
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::FlushPendingActions(), "
"dispatching compositioncommit event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->CommitComposition(status, &action.mData, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"FAILED to dispatch compositioncommit event.", this));
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
}
break;
}
case PendingAction::SET_SELECTION: {
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::FlushPendingActions() "
"flushing SET_SELECTION={ mSelectionStart=%d, "
"mSelectionLength=%d, mSelectionReversed=%s }, "
@@ -1832,17 +1832,17 @@ TSFTextStore::MaybeFlushPendingNotificat
// If it's already been destroyed completely, this shouldn't notify TSF of
// anything anymore.
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::MaybeFlushPendingNotifications(), "
"does nothing because this has already destroyed completely...", this));
return;
}
- if (!mDeferClearingLockedContent && mContentForTSF.IsInitialized()) {
+ if (!mDeferClearingContentForTSF && mContentForTSF.IsInitialized()) {
mContentForTSF.Clear();
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::MaybeFlushPendingNotifications(), "
"mContentForTSF is cleared", this));
}
if (mHasReturnedNoLayoutError) {
MOZ_LOG(sTextStoreLog, LogLevel::Info,
@@ -2010,19 +2010,19 @@ TSFTextStore::ContentForTSFRef()
"GetCurrentText() failure", this));
mContentForTSF.Clear();
return mContentForTSF;
}
mContentForTSF.Init(text);
// Basically, the locked content should be cleared after the document is
// unlocked. However, in e10s mode, content will be modified
- // asynchronously. In such case, mDeferClearingLockedContent may be
+ // asynchronously. In such case, mDeferClearingContentForTSF may be
// true even after the document is unlocked.
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
}
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::ContentForTSFRef(): "
"mContentForTSF={ mText=\"%s\" (Length()=%u), "
"mLastCompositionString=\"%s\" (Length()=%u), "
"mMinTextModifiedOffset=%u }",
this, mContentForTSF.Text().Length() <= 20 ?
@@ -4985,17 +4985,17 @@ TSFTextStore::OnUpdateCompositionInterna
// There are nothing to do after destroyed.
if (mDestroyed) {
return NS_OK;
}
// Now, all sent composition events are handled by the content even in
// e10s mode.
- mDeferClearingLockedContent = false;
+ mDeferClearingContentForTSF = false;
mDeferNotifyingTSF = false;
MaybeFlushPendingNotifications();
return NS_OK;
}
nsresult
TSFTextStore::OnMouseButtonEventInternal(
const IMENotification& aIMENotification)
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -881,17 +881,17 @@ protected:
// true. This is set to false when GetTextExt() or GetACPFromPoint() is
// called.
bool mWaitingQueryLayout;
// During the documet is locked, we shouldn't destroy the instance.
// If this is true, the instance will be destroyed after unlocked.
bool mPendingDestroy;
// If this is false, MaybeFlushPendingNotifications() will clear the
// mContentForTSF.
- bool mDeferClearingLockedContent;
+ bool mDeferClearingContentForTSF;
// While there is native caret, this is true. Otherwise, false.
bool mNativeCaretIsCreated;
// While the instance is dispatching events, the event may not be handled
// synchronously in e10s mode. So, in such case, in strictly speaking,
// we shouldn't query layout information. However, TS_E_NOLAYOUT bugs of
// ITextStoreAPC::GetTextExt() blocks us to behave ideally.
// For preventing it to be called, we should put off notifying TSF of
// anything until layout information becomes available.