mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 916373 - Allow atomless JSEventHandlers, r=nsm
--HG-- extra : rebase_source : 6fa611eb7f078141e4bf6025c50693cfa403d757
This commit is contained in:
parent
a54b64414e
commit
66e5b8a663
@ -951,7 +951,9 @@ nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
nsAutoMicroTask mt;
|
||||
if (mIsMainThreadELM) {
|
||||
nsContentUtils::EnterMicroTask();
|
||||
}
|
||||
// nsIDOMEvent::currentTarget is set in nsEventDispatcher.
|
||||
if (aListener.HasWebIDLCallback()) {
|
||||
ErrorResult rv;
|
||||
@ -961,6 +963,9 @@ nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
|
||||
} else {
|
||||
result = aListener.GetXPCOMCallback()->HandleEvent(aDOMEvent);
|
||||
}
|
||||
if (mIsMainThreadELM) {
|
||||
nsContentUtils::LeaveMicroTask();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -273,7 +273,7 @@ NS_NewJSEventListener(nsIScriptContext* aContext, JSObject* aScopeObject,
|
||||
{
|
||||
MOZ_ASSERT(aContext || aHandler.HasEventHandler(),
|
||||
"Must have a handler if we don't have an nsIScriptContext");
|
||||
NS_ENSURE_ARG(aEventType);
|
||||
NS_ENSURE_ARG(aEventType || !NS_IsMainThread());
|
||||
nsJSEventListener* it =
|
||||
new nsJSEventListener(aContext, aScopeObject, aTarget, aEventType,
|
||||
aHandler);
|
||||
|
Loading…
Reference in New Issue
Block a user