Bug 1850213 - Initialize mInHTMLEditorEventListener. r=masayuki

`mInHTMLEditorEventListener` isn't initialized during IPC, so this variable is
randomly between multi-process.

Also, I try to write a test for it, but drag and drop tests don't seem to
support multi-process.

Differential Revision: https://phabricator.services.mozilla.com/D196694
This commit is contained in:
Makoto Kato 2023-12-18 05:46:13 +00:00
parent e0866e30d7
commit 1f335743e7
2 changed files with 8 additions and 2 deletions

View File

@ -383,7 +383,9 @@ class WidgetDragEvent : public WidgetMouseEvent {
protected:
WidgetDragEvent()
: mUserCancelled(false), mDefaultPreventedOnContent(false) {}
: mUserCancelled(false),
mDefaultPreventedOnContent(false),
mInHTMLEditorEventListener(false) {}
public:
virtual WidgetDragEvent* AsDragEvent() override { return this; }
@ -425,6 +427,8 @@ class WidgetDragEvent : public WidgetMouseEvent {
// XXX mUserCancelled isn't copied, is this intentionally?
mUserCancelled = false;
mDefaultPreventedOnContent = aEvent.mDefaultPreventedOnContent;
// XXX mInHTMLEditorEventListener isn't copied, is this intentionally?
mInHTMLEditorEventListener = false;
}
/**

View File

@ -270,13 +270,15 @@ struct ParamTraits<mozilla::WidgetDragEvent> {
WriteParam(aWriter, static_cast<const mozilla::WidgetMouseEvent&>(aParam));
WriteParam(aWriter, aParam.mUserCancelled);
WriteParam(aWriter, aParam.mDefaultPreventedOnContent);
WriteParam(aWriter, aParam.mInHTMLEditorEventListener);
}
static bool Read(MessageReader* aReader, paramType* aResult) {
bool rv =
ReadParam(aReader, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
ReadParam(aReader, &aResult->mUserCancelled) &&
ReadParam(aReader, &aResult->mDefaultPreventedOnContent);
ReadParam(aReader, &aResult->mDefaultPreventedOnContent) &&
ReadParam(aReader, &aResult->mInHTMLEditorEventListener);
return rv;
}
};