-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when HTMLMediaElement::exitFullscreen is called on a video
element which is not currently full screen https://bugs.webkit.org/show_bug.cgi?id=255970 rdar://108489504 Reviewed by Jer Noble. This change fixes an issue where exitFullScreen is called on video, but the current full screen element is div, due to which we end up scheduling the webkitendfullscreenEvent event for video, which trips over an assertion. * LayoutTests/fullscreen/exit-full-screen-video-crash-expected.txt: Added. * LayoutTests/fullscreen/exit-full-screen-video-crash.html: Added. * Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Originally-landed-as: 259548.703@safari-7615-branch (0ffc79d). rdar://113167859 Canonical link: https://commits.webkit.org/266584@main
- Loading branch information
1 parent
e4c0a68
commit 549d44e
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
LayoutTests/fullscreen/exit-full-screen-video-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS if no crash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
onload = async () => { | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
internals.withUserGesture(() => {}); | ||
let video0 = document.createElement('video'); | ||
video0.src = 'data:video/mp4;'; | ||
document.body.append(video0); | ||
$vm.print(await video0.requestFullscreen()); | ||
navigator.mediaSession.callActionHandler({action: 'play'}); | ||
let div0 = document.createElement('div'); | ||
video0.append(div0); | ||
$vm.print(await div0.requestFullscreen()); | ||
video0.webkitSetPresentationMode('inline'); | ||
document.body.innerHTML = 'PASS if no crash'; | ||
}; | ||
</script> |
2 changes: 2 additions & 0 deletions
2
LayoutTests/platform/gtk/fullscreen/exit-full-screen-video-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: video0.webkitSetPresentationMode is not a function. (In 'video0.webkitSetPresentationMode('inline')', 'video0.webkitSetPresentationMode' is undefined) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters