[webkit-changes] [WebKit/WebKit] 8addb7: [Cocoa] Youtube videos don't always size correctly...

Jer Noble noreply at github.com
Sun Apr 23 11:33:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8addb776de1b2069f92a44ec9571bc6afaa51221
      https://github.com/WebKit/WebKit/commit/8addb776de1b2069f92a44ec9571bc6afaa51221
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2023-04-23 (Sun, 23 Apr 2023)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/html/HTMLVideoElement.cpp
    M Source/WebCore/html/HTMLVideoElement.h
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

  Log Message:
  -----------
  [Cocoa] Youtube videos don't always size correctly, both inline and fullscreen
https://bugs.webkit.org/show_bug.cgi?id=255824
rdar://106974872

Reviewed by Simon Fraser.

When this behavior occurs, the video layer fails to resize itself when layout changes. E.g.,
when going into fullscreen mode, the video layer will retain the original size it had inline.
(Which, to be clear, may also be incorrect.) The layer tree indicates that the incorrect size
is based on a 2:1 (or 300x150) aspect ratio, and the failure to resize indicates that the
VideoFullscreenInterfaceAVKit thinks its videoDimensions are 0x0.

This prospective fix seeks to eliminate a timing issue where, perhaps, the "resize" event is
not being fired when the underlying MediaPlayer changes size. It also adds more logging around
resizing in case this issue happens again that will hopefully aid in diagnostics.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
* Source/WebCore/html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::scheduleResizeEvent):
(WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged):
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::scheduleResizeEvent):
(WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged):
* Source/WebCore/html/HTMLVideoElement.h:
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::updateCachedState):

Canonical link: https://commits.webkit.org/263292@main




More information about the webkit-changes mailing list