Drawing an SVG image into a <canvas> that is not in the DOM draws the wrong region
[WebKit-https.git] / Source / WebCore / ChangeLog
index 0efc2a0..1a476b6 100644 (file)
@@ -1,3 +1,23 @@
+2016-06-30  Antoine Quint  <graouts@apple.com>
+
+        Drawing an SVG image into a <canvas> that is not in the DOM draws the wrong region
+        https://bugs.webkit.org/show_bug.cgi?id=159276
+
+        Reviewed by Dean Jackson.
+
+        In the event where the <img> element that we are passing to CanvasRenderingContext2D.drawImage()
+        points to an SVG resource, we ensure that the container for the SVG image is sized to match the
+        HTML element. The necessity for setting this container size, explained in webkit.org/b/148845,
+        is that we must ensure a cached image does not have an outdated container size.
+
+        Tests: svg/as-image/img-with-svg-resource-in-dom-and-drawImage.html
+               svg/as-image/img-with-svg-resource-in-dom-no-size-and-drawImage.html
+               svg/as-image/img-with-svg-resource-not-in-dom-and-drawImage.html
+               svg/as-image/img-with-svg-resource-not-in-dom-no-size-and-drawImage.html
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage):
+
 2016-06-30  Eric Carlson  <eric.carlson@apple.com>
 
         getUserMedia() exposed, but not functional