mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 672013. Drawing an SVG image to a canvas need not clear its origin-clean flag. r=dholbert,sr=bzbarsky
This commit is contained in:
parent
a033bb0967
commit
7ad0a19ab0
@ -4111,11 +4111,8 @@ nsLayoutUtils::SurfaceFromElement(dom::Element* aElement,
|
||||
result.mSurface = gfxsurf;
|
||||
result.mSize = gfxIntSize(imgWidth, imgHeight);
|
||||
result.mPrincipal = principal.forget();
|
||||
// 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);
|
||||
// no images, including SVG images, can load content from another domain.
|
||||
result.mIsWriteOnly = false;
|
||||
result.mImageRequest = imgRequest.forget();
|
||||
|
||||
return result;
|
||||
|
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function go() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var ctx = canvas.getContext("2d");
|
||||
var image = document.getElementById("image");
|
||||
|
||||
// Draw the SVG image
|
||||
ctx.drawImage(image, 0, 0);
|
||||
|
||||
try {
|
||||
canvas.toDataURL();
|
||||
} catch (ex) {
|
||||
document.body.textContent = ex;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="go()">
|
||||
<canvas id="canvas" width="200" height="200"></canvas>
|
||||
<img id="image" src="lime100x100.svg" style="display: none">
|
||||
</body>
|
||||
</html>
|
@ -41,6 +41,8 @@ fails == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html # XXX
|
||||
== canvas-drawImage-slice-1a.html lime100x100-ref.html
|
||||
fails == canvas-drawImage-slice-1b.html lime100x100-ref.html # XXX all edges fuzzy
|
||||
|
||||
== canvas-drawImage-origin-clean-1.html lime100x100-ref.html
|
||||
|
||||
# Simple <img> tests
|
||||
== img-simple-1.html lime100x100-ref.html
|
||||
== img-simple-2.html lime100x100-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user