[Webkit-unassigned] [Bug 223125] document pictureInPictureElement is null if you Enter Picture in Picture from contextual menu

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 14 07:37:16 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223125

--- Comment #2 from opendarwin at lapcatsoftware.com ---
I debugged with the WebKit source code and discovered the problem.

In the case of clicking the PiP widget it follows this code path:
HTMLVideoElementPictureInPicture::requestPictureInPicture
HTMLVideoElement::setPresentationMode
HTMLMediaElement::enterFullscreen

In the case of the contextual menu it follows this code path:
HitTestResult::toggleEnhancedFullscreenForVideo
HTMLMediaElement::enterFullscreen

In both cases, eventually this code gets called at https://github.com/WebKit/WebKit/blob/main/Source/WebCore/html/HTMLVideoElement.cpp#L504

void HTMLVideoElement::didEnterFullscreenOrPictureInPicture(const FloatSize& size)
{
    if (m_enteringPictureInPicture) {

However, m_enteringPictureInPicture is false with the contextual menu. With the PiP widget m_enteringPictureInPicture is true, because it gets set to true in HTMLVideoElement::setPresentationMode at https://github.com/WebKit/WebKit/blob/main/Source/WebCore/html/HTMLVideoElement.cpp#L490

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210314/0b0559a1/attachment-0001.htm>


More information about the webkit-unassigned mailing list