Bug 694537 - Propagate OOM nsresult from ParseHtml5Fragment to the caller of nsContentUtils::ParseFragmentHTML. r=Olli.Pettay.
authorHenri Sivonen <hsivonen@iki.fi>
Fri, 14 Oct 2011 16:02:36 +0300
changeset 79410 dcbe33e9497171aeee56133f8445e862b0940478
parent 79409 de59e7adc9f651abaccadabea8d95177e630774a
child 79411 046e6eadb285e6b83ae8c5db439da422cbd55875
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersOlli
bugs694537
milestone10.0a1
Bug 694537 - Propagate OOM nsresult from ParseHtml5Fragment to the caller of nsContentUtils::ParseFragmentHTML. r=Olli.Pettay.
content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -3627,24 +3627,25 @@ nsContentUtils::ParseFragmentHTML(const 
   }
   mozilla::AutoRestore<bool> guard(nsContentUtils::sFragmentParsingActive);
   nsContentUtils::sFragmentParsingActive = true;
   if (!sHTMLFragmentParser) {
     sHTMLFragmentParser =
       static_cast<nsHtml5Parser*>(nsHtml5Module::NewHtml5Parser().get());
     // Now sHTMLFragmentParser owns the object
   }
-  sHTMLFragmentParser->ParseHtml5Fragment(aSourceBuffer,
-                                          aTargetNode,
-                                          aContextLocalName,
-                                          aContextNamespace,
-                                          aQuirks,
-                                          aPreventScriptExecution);
+  nsresult rv =
+    sHTMLFragmentParser->ParseHtml5Fragment(aSourceBuffer,
+                                            aTargetNode,
+                                            aContextLocalName,
+                                            aContextNamespace,
+                                            aQuirks,
+                                            aPreventScriptExecution);
   sHTMLFragmentParser->Reset();
-  return NS_OK;
+  return rv;
 }
 
 /* static */
 nsresult
 nsContentUtils::ParseFragmentXML(const nsAString& aSourceBuffer,
                                  nsIDocument* aDocument,
                                  nsTArray<nsString>& aTagStack,
                                  bool aPreventScriptExecution,