Bug 750109, outerhtml crash, r=hsivonen,sicking,a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 23 May 2012 00:00:11 +0300
changeset 92232 c8c144ad11850719c93d796625550b572117f7e7
parent 92231 a79a30e3abe206abcf2380420486d02292747e11
child 92234 a1ff8cc41063d415f372a56542c6c3e793e19a45
push id860
push useropettay@mozilla.com
push dateTue, 22 May 2012 21:00:54 +0000
treeherdermozilla-beta@c8c144ad1185 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen, sicking, akeybl
bugs750109
milestone13.0
Bug 750109, outerhtml crash, r=hsivonen,sicking,a=akeybl
content/html/content/src/nsGenericHTMLElement.cpp
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -798,31 +798,31 @@ nsGenericHTMLElement::SetInnerHTML(const
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsGenericHTMLElement::SetOuterHTML(const nsAString& aOuterHTML)
 {
-  nsINode* parent = GetNodeParent();
+  nsCOMPtr<nsINode> parent = GetNodeParent();
   if (!parent) {
     return NS_OK;
   }
 
   if (parent->NodeType() == nsIDOMNode::DOCUMENT_NODE) {
     return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
   }
 
   if (OwnerDoc()->IsHTML()) {
     nsIAtom* localName;
     PRInt32 namespaceID;
     if (parent->IsElement()) {
-      localName = static_cast<nsIContent*>(parent)->Tag();
-      namespaceID = static_cast<nsIContent*>(parent)->GetNameSpaceID();
+      localName = static_cast<nsIContent*>(parent.get())->Tag();
+      namespaceID = static_cast<nsIContent*>(parent.get())->GetNameSpaceID();
     } else {
       NS_ASSERTION(parent->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
         "How come the parent isn't a document, a fragment or an element?");
       localName = nsGkAtoms::body;
       namespaceID = kNameSpaceID_XHTML;
     }
     nsCOMPtr<nsIDOMDocumentFragment> df;
     nsresult rv = NS_NewDocumentFragment(getter_AddRefs(df),