mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 911951 part.4 Clear the wrong clause information and the caret information at failing to dispatch event r=smaug
This commit is contained in:
parent
ea79a53670
commit
312a2de128
@ -117,13 +117,19 @@ CompositionStringSynthesizer::DispatchEvent(bool* aDefaultPrevented)
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
if (!mClauses.IsEmpty()) {
|
||||
NS_ENSURE_TRUE(mClauses[mClauses.Length()-1].mEndOffset == mString.Length(),
|
||||
NS_ERROR_ILLEGAL_VALUE);
|
||||
if (!mClauses.IsEmpty() &&
|
||||
mClauses[mClauses.Length()-1].mEndOffset != mString.Length()) {
|
||||
NS_WARNING("Sum of length of the all clauses must be same as the string "
|
||||
"length");
|
||||
ClearInternal();
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
if (mCaret.mRangeType == NS_TEXTRANGE_CARETPOSITION) {
|
||||
NS_ENSURE_TRUE(mCaret.mEndOffset <= mString.Length(),
|
||||
NS_ERROR_ILLEGAL_VALUE);
|
||||
if (mCaret.mEndOffset > mString.Length()) {
|
||||
NS_WARNING("Caret position is out of the composition string");
|
||||
ClearInternal();
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
mClauses.AppendElement(mCaret);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user