Bug 1333971 - Label nsHtml5SVGLoadDispatcher runnable. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Mon, 30 Jan 2017 11:57:49 -0800
changeset 468469 544e7e4e88bfd82ce8c094ed864303958d7263bc
parent 468468 962c947c1e50785cf873754081ed9dfc6e9676c2
child 468470 ed8b016100297fdd10f45f02ebf0202b91559a23
push id43477
push userbmo:jhofmann@mozilla.com
push dateTue, 31 Jan 2017 15:48:49 +0000
reviewerssmaug
bugs1333971
milestone54.0a1
Bug 1333971 - Label nsHtml5SVGLoadDispatcher runnable. r=smaug MozReview-Commit-ID: LmCbNw5qQft
dom/xml/nsXMLContentSink.cpp
parser/html/nsHtml5TreeOperation.cpp
--- a/dom/xml/nsXMLContentSink.cpp
+++ b/dom/xml/nsXMLContentSink.cpp
@@ -1095,17 +1095,19 @@ nsXMLContentSink::HandleEndElement(const
     }
     mNotifyLevel = stackLen - 1;
   }
   DidAddContent();
 
   if (content->IsSVGElement(nsGkAtoms::svg)) {
     FlushTags();
     nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(content);
-    if (NS_FAILED(NS_DispatchToMainThread(event))) {
+    if (NS_FAILED(content->OwnerDoc()->Dispatch("nsHtml5SVGLoadDispatcher",
+                                                TaskCategory::Other,
+                                                event.forget()))) {
       NS_WARNING("failed to dispatch svg load dispatcher");
     }
   }
 
   return aInterruptable && NS_SUCCEEDED(result) ? DidProcessATokenImpl() :
                                                   result;
 }
 
--- a/parser/html/nsHtml5TreeOperation.cpp
+++ b/parser/html/nsHtml5TreeOperation.cpp
@@ -614,17 +614,19 @@ nsHtml5TreeOperation::DoneCreatingElemen
 {
   aNode->DoneCreatingElement();
 }
 
 void
 nsHtml5TreeOperation::SvgLoad(nsIContent* aNode)
 {
   nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(aNode);
-  if (NS_FAILED(NS_DispatchToMainThread(event))) {
+  if (NS_FAILED(aNode->OwnerDoc()->Dispatch("nsHtml5SVGLoadDispatcher",
+                                            TaskCategory::Other,
+                                            event.forget()))) {
     NS_WARNING("failed to dispatch svg load dispatcher");
   }
 }
 
 void
 nsHtml5TreeOperation::MarkMalformedIfScript(nsIContent* aNode)
 {
   nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(aNode);