Bug 750109, outerhtml crash, r=hsivonen,sicking,a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 23 May 2012 00:00:19 +0300
changeset 95849 dcc4f7b30335298226f49e69e83bd1cfb7ad6e9c
parent 95848 a5ef446a214cf090b29c740e47de7fe4afd3181e
child 95850 59816d777d62eb68662de98e546ed7409163b67e
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen, sicking, akeybl
bugs750109
milestone14.0a2
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
@@ -804,31 +804,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),