[Webkit-unassigned] [Bug 194746] New: drawImage does not work correctly when source and destination have overlap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 16 08:10:17 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=194746

            Bug ID: 194746
           Summary: drawImage does not work correctly when source and
                    destination have overlap
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: macOS 10.14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: susisu2413 at yahoo.co.jp
                CC: dino at apple.com

When copying a region of a canvas to another region of the same canvas, drawImage does not work correctly if those regions have overlap.

A reproduction code is here: https://jsfiddle.net/kfcea804/
  Expected: Two green overlapping rectangles are drawn.
  Actual: A part of one rectangle is chipped (drawn as white, not green).

The chipped region matches the area of the source region that is overwritten by the drawImage.
I'm not sure, but the cause of this issue may be that WebKit does not taking a copy of the source image before the drawing operation, as opposed to what HTML Living Standard says:

> When a canvas element is drawn onto itself, the drawing model requires the source to be copied before the image is drawn, so it is possible to copy parts of a canvas element onto overlapping parts of itself.

https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage

I am using Safari TP Release 75 (Safari 12.2, WebKit 14608.1.3.0.2) on macOS 10.14.3.
I also checked that this issue is also reproduced with WebKit r241645.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190216/3d3965f3/attachment-0001.html>


More information about the webkit-unassigned mailing list