Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9391ef101e6d253ddb0dd0f8764eeb13d856a0bb
      
https://github.com/WebKit/WebKit/commit/9391ef101e6d253ddb0dd0f8764eeb13d856a0bb
  Author: Said Abou-Hallawa <[email protected]>
  Date:   2026-08-13 (Thu, 13 Aug 2026)

  Changed paths:
    A 
LayoutTests/http/tests/canvas/canvas-tainted-image-capture-video-frame-expected.html
    A 
LayoutTests/http/tests/canvas/canvas-tainted-image-capture-video-frame.html
    A 
LayoutTests/http/tests/canvas/resources/cross-origin-image-capture-video-frame.html
    M Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp

  Log Message:
  -----------
  When captured as a video frame, canvas has to be tainted if cross-origin 
image are drawn into it
https://bugs.webkit.org/show_bug.cgi?id=316594
rdar://171846032

Reviewed by Simon Fraser.

HTMLCanvasElement::captureStream() allows streaming a canvas's output to a 
<video>
element. The track frames of this video is obtained from 
CanvasCaptureMediaStreamTrack
::grabFrame(). This function unconditionally gets a VideoFrame by calling
HTMLCanvasElement::toVideoFrame().

If cross-origin images are drawn into the canvas, this canvas has to be tainted.
So no getImageData() can see the pixels of the cross-origin images.

* 
LayoutTests/http/tests/canvas/canvas-tainted-image-capture-video-frame-expected.html:
 Added.
* LayoutTests/http/tests/canvas/canvas-tainted-image-capture-video-frame.html: 
Added.
* 
LayoutTests/http/tests/canvas/resources/cross-origin-image-capture-video-frame.html:
 Added.
* Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::grabFrame):
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):

Originally-landed-as: [email protected] (723dbeacf061). 
rdar://184744428
Canonical link: https://commits.webkit.org/319101@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to