Bug 1318506 - Label DispatchContentLoaded events with a DocGroup (r=ehsan)
☠☠ backed out by 9efd9724f08f ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Thu, 10 Nov 2016 11:39:22 -0800
changeset 324961 a8b3690476c918318e32b9b88ef2b5894ae4185d
parent 324960 3411c3d9c141131f7bab910231d71d80c7b4ddf2
child 324962 e642f1df626dbca714a2adbae3b3d2365a9b9bfe
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersehsan
bugs1318506
milestone53.0a1
Bug 1318506 - Label DispatchContentLoaded events with a DocGroup (r=ehsan) MozReview-Commit-ID: 8vx2Vzvvxhu
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -5075,19 +5075,20 @@ nsDocument::UnblockDOMContentLoaded()
   MOZ_ASSERT(mBlockDOMContentLoaded);
   if (--mBlockDOMContentLoaded != 0 || mDidFireDOMContentLoaded) {
     return;
   }
   mDidFireDOMContentLoaded = true;
 
   MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
   if (!mSynchronousDOMContentLoaded) {
+    MOZ_RELEASE_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
-    NS_DispatchToCurrentThread(ev);
+    Dispatch("DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
   } else {
     DispatchContentLoadedEvents();
   }
 }
 
 void
 nsDocument::ContentStateChanged(nsIContent* aContent, EventStates aStateMask)
 {