Bug 203989

Summary: Entering/Exiting Picture-in-Picture mode through webkitSetPresentationMode() does not fire events (enterpictureinpicture and leavepictureinpicture) defined in the spec
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: Peng Liu <peng.liu6>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Rebase the patch
eric.carlson: review+
Patch for landing none

Description Peng Liu 2019-11-07 22:02:51 PST
The events are defined in https://w3c.github.io/picture-in-picture/. We want the WebKit prefix version of the picture-in-picture API also fires these events.
Comment 1 Radar WebKit Bug Importer 2019-11-07 22:03:28 PST
<rdar://problem/57011418>
Comment 2 Peng Liu 2019-11-08 12:34:09 PST
Created attachment 383152 [details]
Patch
Comment 3 Peng Liu 2019-11-08 13:36:19 PST
Created attachment 383159 [details]
Rebase the patch
Comment 4 Eric Carlson 2019-11-08 14:06:47 PST
Comment on attachment 383159 [details]
Rebase the patch

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

> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h:91
> +void providePictureInPictureTo(HTMLVideoElement&);

I thinks this would be better as a static method on HTMLVideoElementPictureInPicture than as a free function.
Comment 5 Peng Liu 2019-11-08 15:04:47 PST
Comment on attachment 383159 [details]
Rebase the patch

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

>> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h:91
>> +void providePictureInPictureTo(HTMLVideoElement&);
> 
> I thinks this would be better as a static method on HTMLVideoElementPictureInPicture than as a free function.

Right! Will update that.
Comment 6 Peng Liu 2019-11-08 15:19:15 PST
Created attachment 383171 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2019-11-08 16:38:03 PST
The commit-queue encountered the following flaky tests while processing attachment 383171 [details]:

inspector/model/remote-object-weak-collection.html bug 204016 (authors: drousso@apple.com and joepeck@webkit.org)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Commit Bot 2019-11-08 16:39:36 PST
Comment on attachment 383171 [details]
Patch for landing

Clearing flags on attachment: 383171

Committed r252276: <https://trac.webkit.org/changeset/252276>
Comment 9 Peng Liu 2019-11-10 19:18:21 PST
All reviewed patches have been landed.  Closing bug.