Bug 1964075 - use the correct EventTarget when creating a MessageEvent, r=baku
Differential Revision: https://phabricator.services.mozilla.com/D248270
This commit is contained in:
committed by
opettay@mozilla.com
parent
ee3ece049c
commit
fde50e8b1f
@@ -462,6 +462,7 @@ void Event::PreventDefault(JSContext* aCx, CallerType aCallerType) {
|
||||
void Event::PreventDefaultInternal(bool aCalledByDefaultHandler,
|
||||
nsIPrincipal* aPrincipal) {
|
||||
if (mEvent->mFlags.mInPassiveListener) {
|
||||
if (mOwner) {
|
||||
if (nsPIDOMWindowInner* win = mOwner->GetAsInnerWindow()) {
|
||||
if (Document* doc = win->GetExtantDoc()) {
|
||||
if (!doc->HasWarnedAbout(
|
||||
@@ -473,6 +474,7 @@ void Event::PreventDefaultInternal(bool aCalledByDefaultHandler,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!mEvent->mFlags.mCancelable) {
|
||||
|
||||
@@ -119,8 +119,7 @@ class PostMessageRunnable final : public CancelableRunnable {
|
||||
}
|
||||
|
||||
// Create the event
|
||||
RefPtr<MessageEvent> event =
|
||||
new MessageEvent(mPort->GetOwnerWindow(), nullptr, nullptr);
|
||||
RefPtr<MessageEvent> event = new MessageEvent(mPort, nullptr, nullptr);
|
||||
|
||||
Sequence<OwningNonNull<MessagePort>> ports;
|
||||
if (!mData->TakeTransferredPortsAsSequence(ports)) {
|
||||
|
||||
Reference in New Issue
Block a user