diff options
Diffstat (limited to 'dom/events')
-rw-r--r-- | dom/events/EventListenerManager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index 0774c3296..2add7d009 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -1087,7 +1087,10 @@ EventListenerManager::HandleEventSubType(Listener* aListener, if (NS_SUCCEEDED(result)) { if (mIsMainThreadELM) { - nsContentUtils::EnterMicroTask(); + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + ccjs->EnterMicroTask(); + } } // nsIDOMEvent::currentTarget is set in EventDispatcher. if (listenerHolder.HasWebIDLCallback()) { @@ -1099,7 +1102,10 @@ EventListenerManager::HandleEventSubType(Listener* aListener, result = listenerHolder.GetXPCOMCallback()->HandleEvent(aDOMEvent); } if (mIsMainThreadELM) { - nsContentUtils::LeaveMicroTask(); + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + ccjs->LeaveMicroTask(); + } } } |