Bug 589558, patch 2: Make html5 canvas write-only after an SVG image has been drawn to it. r=roc a=blocking-betaN+

This commit is contained in:
Daniel Holbert 2010-10-12 12:00:31 -07:00
parent 3c294d2cc5
commit 7857adfcb5

View File

@ -3714,7 +3714,12 @@ nsLayoutUtils::SurfaceFromElement(nsIDOMElement *aElement,
result.mSurface = gfxsurf;
result.mSize = gfxIntSize(imgWidth, imgHeight);
result.mPrincipal = principal;
result.mIsWriteOnly = PR_FALSE;
// SVG images could have <foreignObject> and/or <image> elements that load
// content from another domain. For safety, they make the canvas write-only.
// XXXdholbert We could probably be more permissive here if we check that our
// helper SVG document has no elements that could load remote content.
result.mIsWriteOnly = (imgContainer->GetType() == imgIContainer::TYPE_VECTOR);
return result;
}