Bug 215240 - r262456 broke sites that expect webkitDisplayingFullscreen to be true almost immediately
Summary: r262456 broke sites that expect webkitDisplayingFullscreen to be true almost ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks: 248296
  Show dependency treegraph
 
Reported: 2020-08-06 14:16 PDT by Eric Carlson
Modified: 2022-11-23 18:12 PST (History)
13 users (show)

See Also:


Attachments
Patch (12.41 KB, patch)
2020-08-06 15:46 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch (13.06 KB, patch)
2020-08-06 16:00 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch (3.89 KB, patch)
2020-08-08 10:27 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing (4.53 KB, patch)
2020-08-09 19:03 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing (4.54 KB, patch)
2020-08-10 09:37 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
A follow-up patch (2.14 KB, patch)
2020-10-22 14:28 PDT, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2020-08-06 14:16:00 PDT
Some JavaScript libraries expect webkitDisplayingFullscreen to return true immediately after calling webkitEnterFullscreen.
Comment 1 Eric Carlson 2020-08-06 14:16:27 PDT
<rdar://problem/66284042>
Comment 2 Eric Carlson 2020-08-06 15:46:53 PDT
Created attachment 406125 [details]
Patch
Comment 3 Eric Carlson 2020-08-06 16:00:07 PDT
Created attachment 406126 [details]
Patch
Comment 4 youenn fablet 2020-08-07 00:23:03 PDT
Comment on attachment 406126 [details]
Patch

Looks like a nice simplification but iOS sim is not happy.
Let's rerun the test to see whether these were flaky failures.

View in context: https://bugs.webkit.org/attachment.cgi?id=406126&action=review

> Source/WebCore/html/HTMLVideoElement.cpp:355
> +    return isFullscreen();

We could inline it in the header file.

> LayoutTests/media/presentationmodechanged-fired-once.html:22
> +			}, 15000);

Indentation is not correct.

> LayoutTests/media/presentationmodechanged-fired-once.html:53
> +

Unneeded.

> LayoutTests/media/video-presentation-mode.html:20
> +                }, 15000);

This is hit now by the iOSsim bot.
Comment 5 Peng Liu 2020-08-07 12:55:52 PDT
Comment on attachment 406126 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406126&action=review

>> Source/WebCore/html/HTMLVideoElement.cpp:355
>> +    return isFullscreen();
> 
> We could inline it in the header file.

Just realized a problem here. With this change, some layout tests may send requests to change presentation mode before the transition is done. Unfortunately, those requests will be ignore by the video element and then end with a test failure/timeout.

> LayoutTests/media/presentationmodechanged-fired-once.html:20
> +    		setTimeout( () => {

Nit. The space is not needed here.
Comment 6 Eric Carlson 2020-08-08 10:27:29 PDT
Created attachment 406255 [details]
Patch
Comment 7 Darin Adler 2020-08-08 11:10:40 PDT
Are we also doing the evangelism side of this to try to get the Akamai script fixed?
Comment 8 Darin Adler 2020-08-08 11:30:05 PDT
Comment on attachment 406255 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406255&action=review

> Source/WebCore/page/Quirks.cpp:989
> +#if PLATFORM(IOS_FAMILY)

I’d like to see a comment documenting a tiny bit about why we need the quirk and predicting/describing when we can remove it. Can likely be a short comment without tons of details, but should not require looking back at the ChangeLog.

> Source/WebCore/page/Quirks.cpp:1000
> +    return classNames.contains("akamai-html5") && classNames.contains("akamai-media-element");

Could use _s here to make the AtomString construction slightly more efficient. Or use static const AtomString so we make the atom strings only once the first time this function is called.

> Source/WebCore/page/Quirks.h:114
> +    bool needsAkamaiMediaPlayerQuirk(const HTMLElement&) const;

Why not have this function take an HTMLVideoElement instead of an HTMLElement? The is<HTMLVideoElement> check seems wasteful.
Comment 9 Eric Carlson 2020-08-09 19:03:51 PDT
Created attachment 406278 [details]
Patch for landing
Comment 10 Eric Carlson 2020-08-10 09:37:23 PDT
Created attachment 406301 [details]
Patch for landing
Comment 11 Eric Carlson 2020-08-10 10:41:14 PDT
Comment on attachment 406255 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406255&action=review

Thanks for the review!

>> Source/WebCore/page/Quirks.cpp:989
>> +#if PLATFORM(IOS_FAMILY)
> 
> I’d like to see a comment documenting a tiny bit about why we need the quirk and predicting/describing when we can remove it. Can likely be a short comment without tons of details, but should not require looking back at the ChangeLog.

Fixed.

>> Source/WebCore/page/Quirks.cpp:1000
>> +    return classNames.contains("akamai-html5") && classNames.contains("akamai-media-element");
> 
> Could use _s here to make the AtomString construction slightly more efficient. Or use static const AtomString so we make the atom strings only once the first time this function is called.

Great point, changed to use const AtomStrings.

>> Source/WebCore/page/Quirks.h:114
>> +    bool needsAkamaiMediaPlayerQuirk(const HTMLElement&) const;
> 
> Why not have this function take an HTMLVideoElement instead of an HTMLElement? The is<HTMLVideoElement> check seems wasteful.

Fixed.
Comment 12 EWS 2020-08-10 10:49:06 PDT
Committed r265437: <https://trac.webkit.org/changeset/265437>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406301 [details].
Comment 13 Peng Liu 2020-10-22 14:28:55 PDT
Reopening to attach new patch.
Comment 14 Peng Liu 2020-10-22 14:28:57 PDT
Created attachment 412131 [details]
A follow-up patch
Comment 15 Peng Liu 2020-10-22 14:35:50 PDT
Will file a new bug to land the follow-up patch. Closing this bug.