Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION(260575@main): YouTube videos sometimes do not resize prope…
…rly in fullscreen and theater modes https://bugs.webkit.org/show_bug.cgi?id=260025 rdar://112780721 Reviewed by Mike Wyrzykowski. WebAVPlayerLayer needs to know its video's dimensions in order to properly lay out its sublayers. When video dimensions change, VideoFullscreenManagerProxy caches the dimensions in its VideoFullscreenModelContext, updates the WebAVPlayerLayer with the new dimensions, and calls -setNeedsLayout on the layer to trigger a re-layout of its sublayers. However, in rare cases, video dimensions can change before the WebAVPlayerLayer is created. While VideoFullscreenModelContext would cache the dimensions, the WebAVPlayerLayer would not be told about these cached dimensions when it was created, leading it to believe the video had dimensions of 0x0 during -layoutSublayers. Fixed this by setting VideoFullscreenModelContext's cached video dimensions on the WebAVPlayerLayer at creation time to ensure it always lays out with the most recent video dimensions sent to it from the WebContent process. No new tests as I couldn't determine a way to capture the necessary timing in a test. * Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenModelContext::setPlayerLayer): Canonical link: https://commits.webkit.org/266807@main
- Loading branch information