Bug 263036

Summary: object-fit:fill doesn't work for a video element using a canvas stream srcObject
Product: WebKit Reporter: Ali Juma <ajuma>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, bfulgham, eric.carlson, fanchengxin1989, jean-yves.avenard, jer.noble, karlcow, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://pingxingyun.github.io/lark_sr_websdk_demos/test_object_fit/

Description Ali Juma 2023-10-11 14:14:23 PDT
This was originally reported at crbug.com/1491624 for Chrome on iOS, but also reproduces in Safari 17.0 and STP 180 on macOS.

Steps to reproduce:
1. Create a video element with object-fit: fill
2. Create a canvas element
3. Set the video element's srcObject to canvas.captureStream

Expected outcome:
The video fills the video element

Actual outcome:
The video only takes up part of the video element

Visit https://pingxingyun.github.io/lark_sr_websdk_demos/test_object_fit/ and hit the play button to test this out.

In Gecko and Blink, the video element is entirely blue, but in WebKit only the center portion is blue.
Comment 1 Radar WebKit Bug Importer 2023-10-11 15:26:02 PDT
<rdar://problem/116832514>
Comment 2 Ahmad Saleem 2023-10-12 12:04:19 PDT
I am able to reproduce this bug on WebKit ToT as well.
Comment 3 fcx 2023-10-12 18:26:37 PDT
MediaStream from webrtc peerconnection ontrack callback have this problem too.
Comment 4 youenn fablet 2023-10-20 06:46:29 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19339
Comment 5 EWS 2023-10-20 09:21:10 PDT
Committed 269568@main (45f8986d1196): <https://commits.webkit.org/269568@main>

Reviewed commits have been landed. Closing PR #19339 and removing active labels.