Bug 722003 - Fix crash calling getClientRects on non-rendered foreignObject. r=roc

This commit is contained in:
Robert Longson 2012-01-29 08:56:20 +00:00
parent 47f54cc3f1
commit 0ae44350a8
3 changed files with 18 additions and 0 deletions

View File

@ -294,6 +294,10 @@ nsSVGForeignObjectFrame::GetTransformMatrix(nsIFrame* aAncestor,
*aOutAncestor = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(*aOutAncestor, "How did we end up without an outer frame?");
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
return gfx3DMatrix::From2D(gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
}
/* Return the matrix back to the root, factoring in the x and y offsets. */
return gfx3DMatrix::From2D(GetCanvasTMForChildren());
}

View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg">
<marker><foreignObject><span id="x" xmlns="http://www.w3.org/1999/xhtml"></span></foreignObject></marker>
<script>
window.addEventListener("load", function() {
document.getElementById("x").getClientRects();
}, false);
</script>
</svg>

After

Width:  |  Height:  |  Size: 283 B

View File

@ -122,3 +122,4 @@ load 693424-1.svg
load 709920-1.svg
load 709920-2.svg
load 713413-1.svg
load 722003-1.svg