Bug 1242331 part.2 Rename TextChangeDataBase::mCausedByComposition to mCausedOnlyByComposition r=smaug

This commit is contained in:
Masayuki Nakano 2016-01-28 13:28:53 +09:00
parent cc3f0fb62c
commit a3b3a0c367
7 changed files with 21 additions and 16 deletions

View File

@ -134,9 +134,9 @@ public:
return;
}
AppendPrintf("{ mStartOffset=%u, mRemovedEndOffset=%u, mAddedEndOffset=%u, "
"mCausedByComposition=%s }", aData.mStartOffset,
"mCausedOnlyByComposition=%s }", aData.mStartOffset,
aData.mRemovedEndOffset, aData.mAddedEndOffset,
ToChar(aData.mCausedByComposition));
ToChar(aData.mCausedOnlyByComposition));
}
virtual ~TextChangeDataToString() {}
};

View File

@ -1999,7 +1999,7 @@ TabParent::RecvNotifyIMETextChange(const ContentCache& aContentCache,
nsIMEUpdatePreference updatePreference = widget->GetIMEUpdatePreference();
NS_ASSERTION(updatePreference.WantTextChange(),
"Don't call Send/RecvNotifyIMETextChange without NOTIFY_TEXT_CHANGE");
MOZ_ASSERT(!aIMENotification.mTextChangeData.mCausedByComposition ||
MOZ_ASSERT(!aIMENotification.mTextChangeData.mCausedOnlyByComposition ||
updatePreference.WantChangesCausedByComposition(),
"The widget doesn't want text change notification caused by composition");
#endif

View File

@ -725,7 +725,12 @@ struct IMENotification final
// mStartOffset if just removed. The vlaue is offset in the new content.
uint32_t mAddedEndOffset;
bool mCausedByComposition;
// Note that TextChangeDataBase may be the result of merging two or more
// changes especially in e10s mode.
// mCausedOnlyByComposition is true only when *all* merged changes are
// caused by composition.
bool mCausedOnlyByComposition;
bool mOccurredDuringComposition;
uint32_t OldLength() const
@ -797,7 +802,7 @@ struct IMENotification final
mStartOffset = aStartOffset;
mRemovedEndOffset = aRemovedEndOffset;
mAddedEndOffset = aAddedEndOffset;
mCausedByComposition = aCausedByComposition;
mCausedOnlyByComposition = aCausedByComposition;
mOccurredDuringComposition = aOccurredDuringComposition;
}
};

View File

@ -854,7 +854,7 @@ PuppetWidget::NotifyIMEOfTextChange(const IMENotification& aIMENotification)
// if parent process doesn't request NOTIFY_TEXT_CHANGE.
if (mIMEPreferenceOfParent.WantTextChange() &&
(mIMEPreferenceOfParent.WantChangesCausedByComposition() ||
!aIMENotification.mTextChangeData.mCausedByComposition)) {
!aIMENotification.mTextChangeData.mCausedOnlyByComposition)) {
mTabChild->SendNotifyIMETextChange(mContentCache, aIMENotification);
} else {
mTabChild->SendUpdateContentCache(mContentCache);

View File

@ -2165,10 +2165,10 @@ IMENotification::TextChangeDataBase::MergeWith(
const TextChangeDataBase& newData = aOther;
const TextChangeDataBase oldData = *this;
// mCausedByComposition should be true only when all changes are caused by
// composition.
mCausedByComposition =
newData.mCausedByComposition && oldData.mCausedByComposition;
// mCausedOnlyByComposition should be true only when all changes are caused
// by composition.
mCausedOnlyByComposition =
newData.mCausedOnlyByComposition && oldData.mCausedOnlyByComposition;
// mOccurredDuringComposition should be true only when all changes occurred
// during composition.
mOccurredDuringComposition =

View File

@ -785,7 +785,7 @@ struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase>
WriteParam(aMsg, aParam.mStartOffset);
WriteParam(aMsg, aParam.mRemovedEndOffset);
WriteParam(aMsg, aParam.mAddedEndOffset);
WriteParam(aMsg, aParam.mCausedByComposition);
WriteParam(aMsg, aParam.mCausedOnlyByComposition);
WriteParam(aMsg, aParam.mOccurredDuringComposition);
}
@ -794,7 +794,7 @@ struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase>
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) &&
ReadParam(aMsg, aIter, &aResult->mAddedEndOffset) &&
ReadParam(aMsg, aIter, &aResult->mCausedByComposition) &&
ReadParam(aMsg, aIter, &aResult->mCausedOnlyByComposition) &&
ReadParam(aMsg, aIter, &aResult->mOccurredDuringComposition);
}
};

View File

@ -4605,20 +4605,20 @@ TSFTextStore::OnTextChangeInternal(const IMENotification& aIMENotification)
("TSF: 0x%p TSFTextStore::OnTextChangeInternal(aIMENotification={ "
"mMessage=0x%08X, mTextChangeData={ mStartOffset=%lu, "
"mRemovedEndOffset=%lu, mAddedEndOffset=%lu, "
"mCausedByComposition=%s, mOccurredDuringComposition=%s }), "
"mCausedOnlyByComposition=%s, mOccurredDuringComposition=%s }), "
"mSink=0x%p, mSinkMask=%s, mComposition.IsComposing()=%s",
this, aIMENotification.mMessage,
textChangeData.mStartOffset,
textChangeData.mRemovedEndOffset,
textChangeData.mAddedEndOffset,
GetBoolName(textChangeData.mCausedByComposition),
GetBoolName(textChangeData.mCausedOnlyByComposition),
GetBoolName(textChangeData.mOccurredDuringComposition),
mSink.get(),
GetSinkMaskNameStr(mSinkMask).get(),
GetBoolName(mComposition.IsComposing())));
if (textChangeData.mCausedByComposition) {
// Ignore text change notifications caused by composition since it's
if (textChangeData.mCausedOnlyByComposition) {
// Ignore text change notifications caused only by composition since it's
// already been handled internally.
return NS_OK;
}