Capturing a canvas that is not in the DOM can lead to erratic frame rates or no frame emission at all
<rdar://problem/93239022>
Test case is https://jsfiddle.net/0b3dqxeg/
Hi hope this helps: in our solution, canvas with CSS fixed position works
Example missing (sorry): modify the test case to: <canvas id="canvas2" style="position: fixed; bottom: 0; right: 0; width: 100px"></canvas> videos still not playing in 15.4 desktop (they show a red background and nothing else happens)
I did some investigations: - CanvasCaptureMediaStreamTrack::Source::canvasChanged is correctly called each time the not-in-dom canvas is changed but it returns early due to m_canvas->renderingContext()->needsPreparationForDisplay() returning true. - Normally, the page will call updateRendering which will make the actual preparation happening, which in turn will tell CanvasCaptureMediaStreamTrack::Source to generate a frame. This is what happens when canvas is in the DOM. When canvas is not in the DOM, Page::updateRendering is not called as often and this impacts the canvas track frame rate.
Pull request: https://github.com/WebKit/WebKit/pull/901
Committed r294864 (250996@main): <https://commits.webkit.org/250996@main> Reviewed commits have been landed. Closing PR #901 and removing active labels.