Title: [295649] trunk
Revision
295649
Author
commit-qu...@webkit.org
Date
2022-06-17 16:56:33 -0700 (Fri, 17 Jun 2022)

Log Message

video.currentSrc should not be reset when a new load errors
https://bugs.webkit.org/show_bug.cgi?id=225451

Patch by Youssef Soliman <youssefdevel...@gmail.com> on 2022-06-17
Reviewed by Jer Noble.

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-currentSrc-expected.txt:
Covered by existing test which was previously failing.
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):

Media test removed since this condition is already covered by the above WPT test.
* LayoutTests/media/video-currentsrc-cleared.html: Removed.
* LayoutTests/media/video-currentsrc-cleared-expected.txt: Removed.

Canonical link: https://commits.webkit.org/251654@main

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-currentSrc-expected.txt (295648 => 295649)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-currentSrc-expected.txt	2022-06-17 23:47:50 UTC (rev 295648)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-currentSrc-expected.txt	2022-06-17 23:56:33 UTC (rev 295649)
@@ -1,3 +1,3 @@
 
-FAIL Test currentSrc behaviour in various playback scenarios assert_true: Not reset when a new load errors expected true got false
+PASS Test currentSrc behaviour in various playback scenarios
 

Deleted: trunk/LayoutTests/media/video-currentsrc-cleared-expected.txt (295648 => 295649)


--- trunk/LayoutTests/media/video-currentsrc-cleared-expected.txt	2022-06-17 23:47:50 UTC (rev 295648)
+++ trunk/LayoutTests/media/video-currentsrc-cleared-expected.txt	2022-06-17 23:56:33 UTC (rev 295649)
@@ -1,12 +0,0 @@
-
-Check that 'currentsrc' is cleared when there is no media resource.
-
-EVENT(canplaythrough)
-EXPECTED (video.currentSrc.indexOf("content/test") > '-1') OK
-RUN(video.src = ""
-
-EVENT(error)
-EXPECTED (video.currentSrc == '') OK
-
-END OF TEST
-

Deleted: trunk/LayoutTests/media/video-currentsrc-cleared.html (295648 => 295649)


--- trunk/LayoutTests/media/video-currentsrc-cleared.html	2022-06-17 23:47:50 UTC (rev 295648)
+++ trunk/LayoutTests/media/video-currentsrc-cleared.html	2022-06-17 23:56:33 UTC (rev 295649)
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <script src=""
-        <script src=""
-        <script>
-            function error()
-            {
-                testExpected('video.currentSrc', '');
-                consoleWrite('');
-                endTest();
-            }
-
-            function canplaythrough()
-            {
-                testExpected('video.currentSrc.indexOf("content/test")', -1, '>');
-                run('video.src = ""
-                consoleWrite('');
-            }
-
-            function start()
-            {
-                findMediaElement();
-                waitForEvent('error', error);
-                waitForEvent('canplaythrough', canplaythrough);
-                video.src = "" "content/test");
-            }
-        </script>
-    </head>
-    <body _onload_="start()">
-        <video ></video>
-        <p>Check that 'currentsrc' is cleared when there is no media resource.</p>
-    </body>
-</html>

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (295648 => 295649)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-06-17 23:47:50 UTC (rev 295648)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-06-17 23:56:33 UTC (rev 295649)
@@ -1183,7 +1183,6 @@
     m_haveFiredLoadedData = false;
     m_completelyLoaded = false;
     m_havePreparedToPlay = false;
-    setCurrentSrc(URL());
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     m_failedToPlayToWirelessTarget = false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to