mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1242331 part.4 Add TextChangeDataBase::mIncludingChangesWithoutComposition r=smaug
This commit is contained in:
parent
88ab0e4e8e
commit
678f997377
@ -135,11 +135,13 @@ public:
|
||||
}
|
||||
AppendPrintf("{ mStartOffset=%u, mRemovedEndOffset=%u, mAddedEndOffset=%u, "
|
||||
"mCausedOnlyByComposition=%s, "
|
||||
"mIncludingChangesDuringComposition=%s }",
|
||||
"mIncludingChangesDuringComposition=%s, "
|
||||
"mIncludingChangesWithoutComposition=%s }",
|
||||
aData.mStartOffset, aData.mRemovedEndOffset,
|
||||
aData.mAddedEndOffset,
|
||||
ToChar(aData.mCausedOnlyByComposition),
|
||||
ToChar(aData.mIncludingChangesDuringComposition));
|
||||
ToChar(aData.mIncludingChangesDuringComposition),
|
||||
ToChar(aData.mIncludingChangesWithoutComposition));
|
||||
}
|
||||
virtual ~TextChangeDataToString() {}
|
||||
};
|
||||
|
@ -736,6 +736,9 @@ struct IMENotification final
|
||||
// Note that if after the last composition is finished and there are some
|
||||
// changes not caused by composition, this is set to false.
|
||||
bool mIncludingChangesDuringComposition;
|
||||
// mIncludingChangesWithoutComposition is true if there is at least one
|
||||
// change which did occur when there wasn't a composition ongoing.
|
||||
bool mIncludingChangesWithoutComposition;
|
||||
|
||||
uint32_t OldLength() const
|
||||
{
|
||||
@ -809,6 +812,8 @@ struct IMENotification final
|
||||
mCausedOnlyByComposition = aCausedByComposition;
|
||||
mIncludingChangesDuringComposition =
|
||||
!aCausedByComposition && aOccurredDuringComposition;
|
||||
mIncludingChangesWithoutComposition =
|
||||
!aCausedByComposition && !aOccurredDuringComposition;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2169,11 +2169,19 @@ IMENotification::TextChangeDataBase::MergeWith(
|
||||
// by composition.
|
||||
mCausedOnlyByComposition =
|
||||
newData.mCausedOnlyByComposition && oldData.mCausedOnlyByComposition;
|
||||
|
||||
// mIncludingChangesWithoutComposition should be true if at least one of
|
||||
// merged changes occurred without composition.
|
||||
mIncludingChangesWithoutComposition =
|
||||
newData.mIncludingChangesWithoutComposition ||
|
||||
oldData.mIncludingChangesWithoutComposition;
|
||||
|
||||
// mIncludingChangesDuringComposition should be true when at least one of
|
||||
// the merged non-composition changes occurred during the latest composition.
|
||||
|
||||
if (!newData.mCausedOnlyByComposition &&
|
||||
!newData.mIncludingChangesDuringComposition) {
|
||||
MOZ_ASSERT(newData.mIncludingChangesWithoutComposition);
|
||||
MOZ_ASSERT(mIncludingChangesWithoutComposition);
|
||||
// If new change is neither caused by composition nor occurred during
|
||||
// composition, set mIncludingChangesDuringComposition to false because
|
||||
// IME doesn't want outdated text changes as text change during current
|
||||
|
@ -787,6 +787,7 @@ struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase>
|
||||
WriteParam(aMsg, aParam.mAddedEndOffset);
|
||||
WriteParam(aMsg, aParam.mCausedOnlyByComposition);
|
||||
WriteParam(aMsg, aParam.mIncludingChangesDuringComposition);
|
||||
WriteParam(aMsg, aParam.mIncludingChangesWithoutComposition);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
@ -795,7 +796,10 @@ struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase>
|
||||
ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mAddedEndOffset) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mCausedOnlyByComposition) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mIncludingChangesDuringComposition);
|
||||
ReadParam(aMsg, aIter,
|
||||
&aResult->mIncludingChangesDuringComposition) &&
|
||||
ReadParam(aMsg, aIter,
|
||||
&aResult->mIncludingChangesWithoutComposition);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -4606,7 +4606,8 @@ TSFTextStore::OnTextChangeInternal(const IMENotification& aIMENotification)
|
||||
"mMessage=0x%08X, mTextChangeData={ mStartOffset=%lu, "
|
||||
"mRemovedEndOffset=%lu, mAddedEndOffset=%lu, "
|
||||
"mCausedOnlyByComposition=%s, "
|
||||
"mIncludingChangesDuringComposition=%s }), "
|
||||
"mIncludingChangesDuringComposition=%s, "
|
||||
"mIncludingChangesWithoutComposition=%s }), "
|
||||
"mSink=0x%p, mSinkMask=%s, mComposition.IsComposing()=%s",
|
||||
this, aIMENotification.mMessage,
|
||||
textChangeData.mStartOffset,
|
||||
@ -4614,6 +4615,7 @@ TSFTextStore::OnTextChangeInternal(const IMENotification& aIMENotification)
|
||||
textChangeData.mAddedEndOffset,
|
||||
GetBoolName(textChangeData.mCausedOnlyByComposition),
|
||||
GetBoolName(textChangeData.mIncludingChangesDuringComposition),
|
||||
GetBoolName(textChangeData.mIncludingChangesWithoutComposition),
|
||||
mSink.get(),
|
||||
GetSinkMaskNameStr(mSinkMask).get(),
|
||||
GetBoolName(mComposition.IsComposing())));
|
||||
|
Loading…
Reference in New Issue
Block a user