[webkit-changes] [WebKit/WebKit] e1c50a: REGRESSION(260575 at main): YouTube videos sometimes ...
aestes
noreply at github.com
Thu Aug 10 22:08:39 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e1c50afade41377b00036a3bb01d37d5d78a7015
https://github.com/WebKit/WebKit/commit/e1c50afade41377b00036a3bb01d37d5d78a7015
Author: Andy Estes <aestes at apple.com>
Date: 2023-08-10 (Thu, 10 Aug 2023)
Changed paths:
M Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
M Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
Log Message:
-----------
REGRESSION(260575 at main): YouTube videos sometimes do not resize properly 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
More information about the webkit-changes
mailing list