[Webkit-unassigned] [Bug 266918] New: drawImage(detachedOffscreenCanvas) is supposed to throw

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 27 18:40:49 PST 2023


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

            Bug ID: 266918
           Summary: drawImage(detachedOffscreenCanvas) is supposed to
                    throw
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tristan.fraipont at gmail.com
                CC: dino at apple.com

When transferring an OffscreenCanvas its width and height attributes become zero. Drawing such a detached OffscreenCanvas through a 2D context's drawImage() method should thus throw a DOMException (from https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument).  

However it seems the check for the image size still uses the dimension of the OffscreenCanvas from before it got detached as can be seen in both fiddles: https://jsfiddle.net/9zvx6bok/ & https://jsfiddle.net/9zvx6bok/1/

In the first one we draw a detached OffscreenCanvas on a 2D context, where this shouldn't be possible since the reported dimensions are both zero.
In the second one, we do set the OffscreenCanvas's dimension to zero before detaching it. This one throws as expected, demonstrating that drawImage() checks the dimensions before the transfer happened.

-- 
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/20231228/5657f4fe/attachment.htm>


More information about the webkit-unassigned mailing list