Bug 566216. Our parent could be a document fragment. r=dholbert

This commit is contained in:
Boris Zbarsky 2010-05-17 14:18:25 -04:00
parent 2e8a7ea60e
commit ae06132e92
3 changed files with 21 additions and 1 deletions

View File

@ -256,7 +256,7 @@ nsSVGUtils::GetParentElement(nsIContent *aContent)
// otherewise use the explicit one, whether it's null or not...
nsIContent* parent = aContent->GetParent();
return parent ? parent->AsElement() : nsnull;
return parent && parent->IsElement() ? parent->AsElement() : nsnull;
}
float

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg"><animate id="y"/><script>
<![CDATA[
function boom()
{
var r = document.createRange();
r.setEnd(document.getElementById('y'), 0);
r.extractContents();
}
window.addEventListener("load", boom, false);
]]>
</script>
</svg>

After

Width:  |  Height:  |  Size: 293 B

View File

@ -84,3 +84,4 @@ load 522394-1.svg
load 522394-2.svg
load 522394-3.svg
load extref-test-1.xhtml
load 566216-1.svg