summaryrefslogtreecommitdiff
path: root/dom/events
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-22 19:28:33 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:49 -0500
commit43a8113072b96affb2b7a3a7a4e965547d3d0c41 (patch)
treedd685edd37f2bffec27c55060e50ba8289e05760 /dom/events
parent14d115cfe32ab72b7193a4fb74e13c06c6d4cc8f (diff)
downloaduxp-43a8113072b96affb2b7a3a7a4e965547d3d0c41.tar.gz
Bug 1405821 - Move microtask handling to CycleCollectedJSContext
Tag UXP Issue #1344
Diffstat (limited to 'dom/events')
-rw-r--r--dom/events/EventListenerManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp
index 0774c32966..2add7d0090 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();
+ }
}
}