Bug 750109, outerhtml crash, r=hsivonen,sicking
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sun, 20 May 2012 23:54:22 +0300
changeset 96723 6e9d62160729562b976703233fba10e12f6a4b45
parent 96722 0e2cc686b07b32b0e05f2b021a19230abf654df2
child 96724 fb3036d9b9e6a0c493d0bec20b67d57c539100f1
push id1439
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 20:19:22 +0000
treeherdermozilla-aurora@ea74834dccd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen, sicking
bugs750109
milestone15.0a1
Bug 750109, outerhtml crash, r=hsivonen,sicking
content/html/content/src/nsGenericHTMLElement.cpp
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -815,31 +815,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),