⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 265437 in webkit


Ignore:
Timestamp:
Aug 10, 2020, 10:49:01 AM (6 years ago)
Author:
eric.carlson@apple.com
Message:

r262456 broke sites that expect webkitDisplayingFullscreen to be true almost immediately
​https://bugs.webkit.org/show_bug.cgi?id=215240
<rdar://problem/66284042>

Reviewed by Darin Adler.

Add a quirk for sites that use the Akamai Media Player, which begins polling
webkitDisplayingFullscreen every 100ms immediately after entering video fullscreen
mode and exits fullscreen as soon as it returns false. r262456 changed the HTMLMediaPlayer
state machine so webkitDisplayingFullscreen doesn't return true until the fullscreen
window has been opened in the UI process. This was done to fix bugs triggered by
rapidly entering and exiting fullscreen and PiP and make our own fullscreen/PiP tests
less flakey, so instead of reverting the change universally do it as a quirk for sites
using the Akamai Media Player.

  • html/HTMLVideoElement.cpp:

(WebCore::HTMLVideoElement::webkitDisplayingFullscreen):

  • page/Quirks.cpp:

(WebCore::Quirks::needsAkamaiMediaPlayerQuirk const):

  • page/Quirks.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r265432 r265437  
     12020-08-10  Eric Carlson  <eric.carlson@apple.com>
     2
     3        r262456 broke sites that expect webkitDisplayingFullscreen to be true almost immediately
     4        https://bugs.webkit.org/show_bug.cgi?id=215240
     5        <rdar://problem/66284042>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add a quirk for sites that use the Akamai Media Player, which begins polling
     10        `webkitDisplayingFullscreen` every 100ms immediately after entering video fullscreen
     11        mode and exits fullscreen as soon as it returns false. r262456 changed the HTMLMediaPlayer
     12        state machine so `webkitDisplayingFullscreen` doesn't return `true` until the fullscreen
     13        window has been opened in the UI process. This was done to fix bugs triggered by
     14        rapidly entering and exiting fullscreen and PiP and make our own fullscreen/PiP tests
     15        less flakey, so instead of reverting the change universally do it as a quirk for sites
     16        using the Akamai Media Player.
     17
     18        * html/HTMLVideoElement.cpp:
     19        (WebCore::HTMLVideoElement::webkitDisplayingFullscreen):
     20        * page/Quirks.cpp:
     21        (WebCore::Quirks::needsAkamaiMediaPlayerQuirk const):
     22        * page/Quirks.h:
     23
    1242020-08-10  Antti Koivisto  <antti@apple.com>
    225
  • trunk/Source/WebCore/html/HTMLVideoElement.cpp

    r264684 r265437  
    353353bool HTMLVideoElement::webkitDisplayingFullscreen()
    354354{
     355    if (document().quirks().needsAkamaiMediaPlayerQuirk(*this))
     356        return isFullscreen() || m_isChangingPresentationMode;
     357
    355358    // This function starts to return true after the video element has entered
    356359    // fullscreen/picture-in-picture until it has exited fullscreen/picture-in-picture
  • trunk/Source/WebCore/page/Quirks.cpp

    r265167 r265437  
    3939#include "HTMLMetaElement.h"
    4040#include "HTMLObjectElement.h"
     41#include "HTMLVideoElement.h"
    4142#include "JSEventListener.h"
    4243#include "LayoutUnit.h"
    … …  
    984985}
    985986
    986 
    987 }
     987// FIXME: remove this once rdar://66739450 has been fixed.
     988bool Quirks::needsAkamaiMediaPlayerQuirk(const HTMLVideoElement& element) const
     989{
     990#if PLATFORM(IOS_FAMILY)
     991    // Akamai Media Player begins polling `webkitDisplayingFullscreen` every 100ms immediately after calling
     992    // `webkitEnterFullscreen` and exits fullscreen as soon as it returns false. r262456 changed the HTMLMediaPlayer state
     993    // machine so `webkitDisplayingFullscreen` doesn't return true until the fullscreen window has been opened in the
     994    // UI process, which causes Akamai Media Player to frequently exit fullscreen mode immediately.
     995
     996    static NeverDestroyed<const AtomString> akamaiHTML5(MAKE_STATIC_STRING_IMPL("akamai-html5"));
     997    static NeverDestroyed<const AtomString> akamaiMediaElement(MAKE_STATIC_STRING_IMPL("akamai-media-element"));
     998
     999    if (!needsQuirks())
     1000        return false;
     1001
     1002    if (!element.hasClass())
     1003        return false;
     1004
     1005    auto& classNames = element.classNames();
     1006    return classNames.contains(akamaiHTML5) && classNames.contains(akamaiMediaElement);
     1007#else
     1008    UNUSED_PARAM(element);
     1009    return false;
     1010#endif
     1011}
     1012
     1013}
  • trunk/Source/WebCore/page/Quirks.h

    r265167 r265437  
    111111    bool needsVP9FullRangeFlagQuirk() const;
    112112    bool needsHDRPixelDepthQuirk() const;
     113   
     114    bool needsAkamaiMediaPlayerQuirk(const HTMLVideoElement&) const;
    113115
    114116private:
Note: See TracChangeset for help on using the changeset viewer.