[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric.carlson at apple.com eric.carlson at apple.com
Thu Apr 8 01:14:57 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 1036f3c773a7547a216198a19b7aafce6af38333
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 19 21:07:50 2010 +0000

    2010-01-19  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Adam Roben.
    
            error events don't fire if no <source> elements passed to media engine
            https://bugs.webkit.org/show_bug.cgi?id=33855
    
            Test: media/video-source-error-no-candidate.html
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::selectMediaResource): Only bail early if
            there is no 'src' attribute and no <source> child elements at all.
    
    2010-01-19  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Adam Roben.
    
            error events don't fire if no <source> elements passed to media engine
            https://bugs.webkit.org/show_bug.cgi?id=33855
    
            * media/video-source-error-no-candidate-expected.txt: Added.
            * media/video-source-error-no-candidate.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53486 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a110fc1..b694cc5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,16 @@
 
         Reviewed by Adam Roben.
 
+        error events don't fire if no <source> elements passed to media engine
+        https://bugs.webkit.org/show_bug.cgi?id=33855
+
+        * media/video-source-error-no-candidate-expected.txt: Added.
+        * media/video-source-error-no-candidate.html: Added.
+
+2010-01-19  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Adam Roben.
+
         video.networkState remains NETWORK_LOADING indefinitely when no <source> element was able to be loaded
         https://bugs.webkit.org/show_bug.cgi?id=33744
 
diff --git a/LayoutTests/media/video-source-error-no-candidate-expected.txt b/LayoutTests/media/video-source-error-no-candidate-expected.txt
new file mode 100644
index 0000000..092ae4b
--- /dev/null
+++ b/LayoutTests/media/video-source-error-no-candidate-expected.txt
@@ -0,0 +1,15 @@
+Test that 'error' events are fired when no urls are passed to the media engine.
+
+EVENT(loadstart)
+
+EVENT(error) from <source id='missing-src' src=''> OK
+EXPECTED (video.error == 'null') OK
+
+EVENT(error) from <source id='bogus-type' src='content/test.mp4'> OK
+EXPECTED (video.error == 'null') OK
+
+EVENT(error) from <source id='unsupported-media-query' src='content/test.mp4'> OK
+EXPECTED (video.error == 'null') OK
+
+END OF TEST
+
diff --git a/LayoutTests/media/video-source-error-no-candidate.html b/LayoutTests/media/video-source-error-no-candidate.html
new file mode 100644
index 0000000..fac1ffb
--- /dev/null
+++ b/LayoutTests/media/video-source-error-no-candidate.html
@@ -0,0 +1,58 @@
+<html lang="en">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <title>&lt;video&gt; and &lt;source&gt; error test</title>
+        <script src=video-test.js></script>
+
+        <script>
+
+            var sources = [];
+            var errorCount = 0;
+
+            function errorEvent(evt)
+            {
+                consoleWrite("");
+
+                var ndx;
+                for (ndx = 0; ndx < sources.length; ndx++) {
+                    if (sources[ndx] == evt.target)
+                        break;
+                }
+
+                if (sources[ndx] == evt.target)
+                    logResult(true, "EVENT(error) from &lt;source id='<em>" + evt.target.id + "</em>' src='<em>" + relativeURL(evt.target.src) + "</em>'&gt;");
+                else
+                    logResult(false, "EVENT(error) from " + evt.target);
+
+                testExpected("video.error", null);
+                
+                if (++errorCount == 3) {
+                    consoleWrite("");
+                    setTimeout(endTest, 1000);
+                }
+            }
+
+            function start()
+            {
+                document.addEventListener("error", errorEvent, true);
+
+                sources = document.getElementsByTagName('source');
+
+                findMediaElement();
+                waitForEvent("loadstart");
+            }
+        </script>
+    </head>
+
+    <body onload="start()">
+
+        <video controls>
+            <source id=missing-src type="video/blahblah">
+            <source id=bogus-type src=content/test.mp4 type="video/blahblah">
+            <source id=unsupported-media-query src=content/test.mp4 media=print>
+        </video>
+        
+        <p>Test that 'error' events are fired when no urls are passed to the media engine.</p>
+
+    </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da5b051..ef7caec 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-19  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Adam Roben.
+
+        error events don't fire if no <source> elements passed to media engine
+        https://bugs.webkit.org/show_bug.cgi?id=33855
+
+        Test: media/video-source-error-no-candidate.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::selectMediaResource): Only bail early if
+        there is no 'src' attribute and no <source> child elements at all.
+
 2010-01-19  Daniel Bates  <dbates at webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 84ae688..01b0fae 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -483,15 +483,24 @@ void HTMLMediaElement::selectMediaResource()
 
     // 2 - Asynchronously await a stable state.
 
-    // 3 - If the media element has neither a src attribute nor any source element children, run these substeps
+    // 3 - ... the media element has neither a src attribute ...
     String mediaSrc = getAttribute(srcAttr);
-    if (!mediaSrc && !havePotentialSourceChild()) {
-        m_loadState = WaitingForSource;
+    if (!mediaSrc) {
+        // ... nor a source element child: ...
+        Node* node;
+        for (node = firstChild(); node; node = node->nextSibling()) {
+            if (node->hasTagName(sourceTag))
+                break;
+        }
 
-        // 1 - Set the networkState to NETWORK_EMPTY and abort these steps
-        m_networkState = NETWORK_EMPTY;
-        ASSERT(!m_delayingTheLoadEvent);
-        return;
+        if (!node) {
+            m_loadState = WaitingForSource;
+
+            // ... set the networkState to NETWORK_EMPTY, and abort these steps
+            m_networkState = NETWORK_EMPTY;
+            ASSERT(!m_delayingTheLoadEvent);
+            return;
+        }
     }
 
     // 4

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list