Bug 1851730 - Pass known value to PrepareEditor() when deferring preparation. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D187981
This commit is contained in:
Emilio Cobos Álvarez
2023-09-13 09:05:51 +00:00
parent e29c0d0b27
commit 96290c11e1
2 changed files with 17 additions and 5 deletions

View File

@@ -1175,9 +1175,10 @@ class MOZ_STACK_CLASS AutoTextControlHandlingState {
if (!mParent && mTextControlStateDestroyed) {
mTextControlState.DeleteOrCacheForReuse();
}
if (!mTextControlStateDestroyed && mPreareEditorLater) {
if (!mTextControlStateDestroyed && mPrepareEditorLater) {
MOZ_ASSERT(nsContentUtils::IsSafeToRunScript());
mTextControlState.PrepareEditor();
MOZ_ASSERT(Is(TextControlAction::SetValue));
mTextControlState.PrepareEditor(&mSettingValue);
}
}
@@ -1204,7 +1205,7 @@ class MOZ_STACK_CLASS AutoTextControlHandlingState {
settingValue = handlingSomething;
}
}
settingValue->mPreareEditorLater = true;
settingValue->mPrepareEditorLater = true;
}
/**
@@ -1321,7 +1322,7 @@ class MOZ_STACK_CLASS AutoTextControlHandlingState {
if (mTextControlAction == aTextControlAction) {
return true;
}
return mParent ? mParent->IsHandling(aTextControlAction) : false;
return mParent && mParent->IsHandling(aTextControlAction);
}
TextControlElement* GetTextControlElement() const { return mTextCtrlElement; }
TextInputListener* GetTextInputListener() const { return mTextInputListener; }
@@ -1377,7 +1378,7 @@ class MOZ_STACK_CLASS AutoTextControlHandlingState {
TextControlAction const mTextControlAction;
bool mTextControlStateDestroyed = false;
bool mEditActionHandled = false;
bool mPreareEditorLater = false;
bool mPrepareEditorLater = false;
bool mBeforeInputEventHasBeenDispatched = false;
};