Bug 842463 - Prevent crash when feImage is not in a document. r=dzbarsky.

This commit is contained in:
Jonathan Watt 2013-02-19 14:09:06 +00:00
parent 2386db5500
commit 054836f817
3 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var f = document.createElementNS("http://www.w3.org/2000/svg", "feImage");
f.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "#s");
}
</script>
</head>
<body onload="boom();"></body>
</html>

View File

@ -63,3 +63,5 @@ load 751515-1.svg
load 761507-1.svg
load 831561.html
load 837450-1.svg
load 842463-1.html

View File

@ -5753,7 +5753,7 @@ nsSVGFEImageElement::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRec
void
nsSVGFEImageElement::Invalidate()
{
if (GetParent()->IsSVG(nsGkAtoms::filter)) {
if (GetParent() && GetParent()->IsSVG(nsGkAtoms::filter)) {
static_cast<SVGFilterElement*>(GetParent())->Invalidate();
}
}