Title: [252675] trunk
Revision
252675
Author
commit-qu...@webkit.org
Date
2019-11-19 18:37:16 -0800 (Tue, 19 Nov 2019)

Log Message

Assertion failure in HTMLMediaElement::enterFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=204376

Patch by Peng Liu <peng.l...@apple.com> on 2019-11-19
Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-set-presentation-mode-to-inline.html

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::setFullscreenMode):

LayoutTests:

* media/video-set-presentation-mode-to-inline-expected.txt: Added.
* media/video-set-presentation-mode-to-inline.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (252674 => 252675)


--- trunk/LayoutTests/ChangeLog	2019-11-20 02:28:52 UTC (rev 252674)
+++ trunk/LayoutTests/ChangeLog	2019-11-20 02:37:16 UTC (rev 252675)
@@ -1,3 +1,13 @@
+2019-11-19  Peng Liu  <peng.l...@apple.com>
+
+        Assertion failure in HTMLMediaElement::enterFullscreen()
+        https://bugs.webkit.org/show_bug.cgi?id=204376
+
+        Reviewed by Eric Carlson.
+
+        * media/video-set-presentation-mode-to-inline-expected.txt: Added.
+        * media/video-set-presentation-mode-to-inline.html: Added.
+
 2019-11-19  Sihui Liu  <sihui_...@apple.com>
 
         IndexedDB: overflow of KeyGenerator in MemoryIDBBackingStore

Added: trunk/LayoutTests/media/video-set-presentation-mode-to-inline-expected.txt (0 => 252675)


--- trunk/LayoutTests/media/video-set-presentation-mode-to-inline-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/video-set-presentation-mode-to-inline-expected.txt	2019-11-20 02:37:16 UTC (rev 252675)
@@ -0,0 +1,10 @@
+This tests that setting the presentation mode of a video element to inline when it is in inline will not crash.
+
+RUN(internals.settings.setAllowsPictureInPictureMediaPlayback(true))
+RUN(video.src = "" "content/test"))
+EVENT(canplaythrough)
+RUN(video.play())
+RUN(video.webkitSetPresentationMode("inline"))
+RUN(video.webkitSetPresentationMode("inline"))
+END OF TEST
+

Added: trunk/LayoutTests/media/video-set-presentation-mode-to-inline.html (0 => 252675)


--- trunk/LayoutTests/media/video-set-presentation-mode-to-inline.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-set-presentation-mode-to-inline.html	2019-11-20 02:37:16 UTC (rev 252675)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src=""
+    <script src=""
+    <script>
+        var eventCount = 0;
+
+        function go()
+        {
+            findMediaElement();
+            run('internals.settings.setAllowsPictureInPictureMediaPlayback(true)');
+            run('video.src = "" "content/test")');
+            waitForEventOnce('canplaythrough', canPlayThrough);
+        }
+
+        function canPlayThrough()
+        {
+            runWithKeyDown('video.play()');
+            runWithKeyDown('video.webkitSetPresentationMode("inline")');
+            runWithKeyDown('video.webkitSetPresentationMode("inline")');
+            endTest();
+        }
+    </script>
+</head>
+<body _onload_="go()">
+    <div>This tests that setting the presentation mode of a video element to inline when it is in inline will not crash.</div>
+    <video controls></video>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (252674 => 252675)


--- trunk/Source/WebCore/ChangeLog	2019-11-20 02:28:52 UTC (rev 252674)
+++ trunk/Source/WebCore/ChangeLog	2019-11-20 02:37:16 UTC (rev 252675)
@@ -1,3 +1,15 @@
+2019-11-19  Peng Liu  <peng.l...@apple.com>
+
+        Assertion failure in HTMLMediaElement::enterFullscreen()
+        https://bugs.webkit.org/show_bug.cgi?id=204376
+
+        Reviewed by Eric Carlson.
+
+        Test: media/video-set-presentation-mode-to-inline.html
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::setFullscreenMode):
+
 2019-11-19  Sihui Liu  <sihui_...@apple.com>
 
         IndexedDB: pass along error of IDBBackingStore operations

Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (252674 => 252675)


--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2019-11-20 02:28:52 UTC (rev 252674)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2019-11-20 02:37:16 UTC (rev 252675)
@@ -474,8 +474,10 @@
     }
 #endif
 
-    if (mode == VideoFullscreenModeNone && isFullscreen()) {
-        exitFullscreen();
+    if (mode == VideoFullscreenModeNone) {
+        if (isFullscreen())
+            exitFullscreen();
+
         return;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to