Bug 694953 - Check the node type of an <svg:mpath> link before derefencing the link, not just the node name, r=dholbert
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 20 Oct 2011 12:03:18 -0400
changeset 80370 bae188e97e34726aea6b4755eef343d691b57f9f
parent 80369 ffbfb6a8d250b6621f667665fa857778b22f153d
child 80371 5314e3475f86e6f3691579bfbde4a935972e85cb
push id434
push userclegnitto@mozilla.com
push dateWed, 21 Dec 2011 12:10:54 +0000
treeherdermozilla-beta@bddb6ed8dd47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs694953
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 694953 - Check the node type of an <svg:mpath> link before derefencing the link, not just the node name, r=dholbert
content/svg/content/src/nsSVGMpathElement.cpp
--- a/content/svg/content/src/nsSVGMpathElement.cpp
+++ b/content/svg/content/src/nsSVGMpathElement.cpp
@@ -224,16 +224,17 @@ nsSVGMpathElement::GetReferencedPath()
     NS_ABORT_IF_FALSE(!mHrefTarget.get(),
                       "We shouldn't have an xlink:href target "
                       "if we don't have an xlink:href attribute");
     return nsnull;
   }
 
   nsIContent* genericTarget = mHrefTarget.get();
   if (genericTarget &&
+      genericTarget->GetNameSpaceID() == kNameSpaceID_SVG &&
       genericTarget->Tag() == nsGkAtoms::path) {
     return static_cast<nsSVGPathElement*>(genericTarget);
   }
   return nsnull;
 }
 
 //----------------------------------------------------------------------
 // Protected helper methods