Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[visionOS] Videos on youtube.com are cropped in compatibility mode wh…
…en using a mobile UA https://bugs.webkit.org/show_bug.cgi?id=260192 rdar://112444285 Reviewed by Mike Wyrzykowski and Richard Robinson. Unlike the desktop site, YouTube's mobile site fullscreens the <video> element rather than an element containing the <video>. Currently, on visionOS, WebKit always uses element fullscreen (rather than the native player) when playing fullscreen <video>. However, this results in cropping on YouTube's mobile site as YouTube sets `object-fit: cover` on the <video>. On iPadOS, this CSS would have no observable effect, as the native player is used. This issue does not reproduce with YouTube's mobile site in Safari on visionOS, even though element fullscreen is enforced, as the fullscreen window's aspect ratio matches the <video>. However, in compatibility mode, the fullscreen behavior should match iPadOS. Fix by ensuring element fullscreen is not forced for <video> fullscreen in compatibility mode. * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): Use the existing `videoFullscreenRequiresElementFullscreen` to determine whether to force element fullscreen for <video>. This flag is only true when running on visionOS, and compatibility mode is not active. Canonical link: https://commits.webkit.org/266920@main
- Loading branch information