Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cocoa] Sometimes a YouTube video is incorrectly sized, and doesn't r…
…espond to window resize https://bugs.webkit.org/show_bug.cgi?id=257628 rdar://109754524 Reviewed by Simon Fraser. `-[WebAVPlayerLayer layoutSublayers]` will calculate a `targetVideoFrame` based on the current videoLayer's bounds, the videoDimensions, and gravity. If this value matches the current video frame, it bails out early without making any changes. However, it doesn't save `targetVideoFrame` to `_targetVideoFrame`. If the gravity, videoDimensions, or even the videoLayer's bounds change, and there's an existing pending call to `-resolveBounds`, an incorrent frame will be set on the videoLayer (whatever the last successful call to `-layoutSublayers` generated). Rather than create a local `targetVideoFrame`, just save the results of calling `-calculateTargetVideoFrame` to the `_targetVideoFrame` ivar. This ensures that subsequent calls to `-resolveBounds` operate on the correct values. Extensive drive-by fix: In investigating this bug, there were a number of times where logging which included a frame's location would have been useful. But FloatPoint and FloatRect don't have logging methods to convert their values to a String (only FloatSize does). So this patch adds those missing logging methods and converts existing logging to log the whole rect. * Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm: (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer resolveBounds]): * Source/WebCore/platform/graphics/FloatPoint.cpp: (WebCore::FloatPoint::toJSONObject const): (WebCore::FloatPoint::toJSONString const): * Source/WebCore/platform/graphics/FloatPoint.h: (WTF::LogArgument<WebCore::FloatPoint>::toString): * Source/WebCore/platform/graphics/FloatRect.cpp: (WebCore::FloatRect::toJSONObject const): (WebCore::FloatRect::toJSONString const): * Source/WebCore/platform/graphics/FloatRect.h: (WTF::LogArgument<WebCore::FloatRect>::toString): * Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoLayer): * Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenModelContext::setVideoLayerFrame): Canonical link: https://commits.webkit.org/264832@main
- Loading branch information
Showing
7 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters