RESOLVED FIXED Bug 216287
Returning to element fullscreen from PiP is not stable under stress tests
https://bugs.webkit.org/show_bug.cgi?id=216287
Summary Returning to element fullscreen from PiP is not stable under stress tests
Peng Liu
Reported 2020-09-08 15:31:35 PDT
Return to element fullscreen from PiP is not stable under stress tests
Attachments
Patch (25.70 KB, patch)
2020-09-08 16:39 PDT, Peng Liu
no flags
Fix an api test failure on Mac (34.46 KB, patch)
2020-09-10 21:34 PDT, Peng Liu
no flags
Update the patch based on Jer's comments (35.08 KB, patch)
2020-09-14 13:27 PDT, Peng Liu
no flags
Radar WebKit Bug Importer
Comment 1 2020-09-08 15:32:24 PDT
Peng Liu
Comment 2 2020-09-08 16:39:47 PDT
Peng Liu
Comment 3 2020-09-10 21:34:41 PDT
Created attachment 408510 [details] Fix an api test failure on Mac
Jer Noble
Comment 4 2020-09-14 10:47:38 PDT
Comment on attachment 408510 [details] Fix an api test failure on Mac View in context: https://bugs.webkit.org/attachment.cgi?id=408510&action=review > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:700 > + videoFullscreenManager->setClient(&_videoFullscreenManagerProxyClient); Here. > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:851 > + videoFullscreenManager->setClient(nullptr); And here. > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:932 > + if (![self isFullScreen]) { > + if (auto* videoFullscreenManager = self._videoFullscreenManager) > + videoFullscreenManager->setClient(nullptr); > + } And here. > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:655 > + if (auto* videoFullscreenManager = self._videoFullscreenManager) > + videoFullscreenManager->setClient(nullptr); And here. > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:691 > + if (auto* videoFullscreenManager = self._videoFullscreenManager) > + videoFullscreenManager->setClient(&_videoFullscreenManagerProxyClient); And here. What will happen if some other piece of code reset videoFullScreenManager's client, perhaps by requesting fullscreen before this animation is complete? VideoFullscreenManager is a singleton, so would that cause us to get into a bad state in the manager's state machine?
Peng Liu
Comment 5 2020-09-14 11:24:39 PDT
Comment on attachment 408510 [details] Fix an api test failure on Mac View in context: https://bugs.webkit.org/attachment.cgi?id=408510&action=review >> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:851 >> + videoFullscreenManager->setClient(nullptr); > > And here. I guess it is better to move this section out of the _repaintCallback? >> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:691 >> + videoFullscreenManager->setClient(&_videoFullscreenManagerProxyClient); > > And here. > > What will happen if some other piece of code reset videoFullScreenManager's client, perhaps by requesting fullscreen before this animation is complete? VideoFullscreenManager is a singleton, so would that cause us to get into a bad state in the manager's state machine? FullscreenManager has the logic to ignore a new fullscreen mode changing request if the current request is not completed yet. Also, WKFullScreenWindowControllerVideoFullscreenManagerProxyClient is the only one client of VideoFullscreenManagerProxy, and only WKFullScreenWindowController calls VideoFullscreenManagerProxy::setClient(). So I believe the code is safe.
Jer Noble
Comment 6 2020-09-14 12:02:29 PDT
(In reply to Peng Liu from comment #5) > Comment on attachment 408510 [details] > Fix an api test failure on Mac > > View in context: > https://bugs.webkit.org/attachment.cgi?id=408510&action=review > > >> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:851 > >> + videoFullscreenManager->setClient(nullptr); > > > > And here. > > I guess it is better to move this section out of the _repaintCallback? > > >> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:691 > >> + videoFullscreenManager->setClient(&_videoFullscreenManagerProxyClient); > > > > And here. > > > > What will happen if some other piece of code reset videoFullScreenManager's client, perhaps by requesting fullscreen before this animation is complete? VideoFullscreenManager is a singleton, so would that cause us to get into a bad state in the manager's state machine? > > FullscreenManager has the logic to ignore a new fullscreen mode changing > request if the current request is not completed yet. Also, > WKFullScreenWindowControllerVideoFullscreenManagerProxyClient is the only > one client of VideoFullscreenManagerProxy, and only > WKFullScreenWindowController calls VideoFullscreenManagerProxy::setClient(). > So I believe the code is safe. Might be worthwhile to put some ASSERT() statements around the setClient() calls, to catch this case should things ever go wrong. I.e., assert that client is NULL when set, and that it's `this` when cleared.
Peng Liu
Comment 7 2020-09-14 13:27:40 PDT
Created attachment 408739 [details] Update the patch based on Jer's comments
Peng Liu
Comment 8 2020-09-14 13:28:57 PDT
Comment on attachment 408510 [details] Fix an api test failure on Mac View in context: https://bugs.webkit.org/attachment.cgi?id=408510&action=review >>>> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:851 >>>> + videoFullscreenManager->setClient(nullptr); >>> >>> And here. >> >> I guess it is better to move this section out of the _repaintCallback? > > Might be worthwhile to put some ASSERT() statements around the setClient() calls, to catch this case should things ever go wrong. I.e., assert that client is NULL when set, and that it's `this` when cleared. Good point!
EWS
Comment 9 2020-09-14 15:39:55 PDT
Committed r267053: <https://trac.webkit.org/changeset/267053> All reviewed patches have been landed. Closing bug and clearing flags on attachment 408739 [details].
Note You need to log in before you can comment on or make changes to this bug.