[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:48 UTC 2010


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

    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
    
            Test: media/video-source-none-supported.html
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::loadNextSourceChild): Call waitForSourceChange if
                there are no valid source elements.
            (WebCore::HTMLMediaElement::waitForSourceChange): New, set networkState to NETWORK_NO_SOURCE.
            (WebCore::HTMLMediaElement::setNetworkState): Call waitForSourceChange if the movie
                hasn't reached HAVE_METADATA and there are no more <source> elements to try.
            * html/HTMLMediaElement.h: Declare waitForSourceChange.
    
    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
    
            * media/video-source-none-supported-expected.txt: Added.
            * media/video-source-none-supported.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53478 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c63090c..a110fc1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+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
+
+        * media/video-source-none-supported-expected.txt: Added.
+        * media/video-source-none-supported.html: Added.
+
 2010-01-19  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Adam Treat.
diff --git a/LayoutTests/media/video-source-none-supported-expected.txt b/LayoutTests/media/video-source-none-supported-expected.txt
new file mode 100644
index 0000000..8a44afc
--- /dev/null
+++ b/LayoutTests/media/video-source-none-supported-expected.txt
@@ -0,0 +1,7 @@
+1. Test that no usable <source> element leaves the media element with networkState == NETWORK_NO_SOURCE
+
+EVENT(error)
+EXPECTED (event.target.tagName == 'SOURCE') OK
+EXPECTED (video.networkState == '4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-source-none-supported.html b/LayoutTests/media/video-source-none-supported.html
new file mode 100644
index 0000000..044dead
--- /dev/null
+++ b/LayoutTests/media/video-source-none-supported.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>no usable &lt;source&gt; test</title>
+    <script src=video-test.js></script>
+    <script>
+        function setup()
+        {
+            document.addEventListener("error", errorEvent, true);
+        }
+
+        function errorEvent(evt)
+        {
+            consoleWrite("EVENT(error)");
+
+            testExpected("event.target.tagName", "SOURCE", "==");
+
+            findMediaElement();
+            testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "==");
+            endTest();
+        }
+
+    </script>
+</head>
+<body>
+    <video controls><source src="doesnotexist.mp4"></video>
+
+    <p>1. Test that no usable &lt;source&gt; element leaves the media element with 
+    networkState == NETWORK_NO_SOURCE</p>
+
+    <script>setup();</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b85233d..a886da5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+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
+
+        Test: media/video-source-none-supported.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::loadNextSourceChild): Call waitForSourceChange if
+            there are no valid source elements.
+        (WebCore::HTMLMediaElement::waitForSourceChange): New, set networkState to NETWORK_NO_SOURCE.
+        (WebCore::HTMLMediaElement::setNetworkState): Call waitForSourceChange if the movie
+            hasn't reached HAVE_METADATA and there are no more <source> elements to try.
+        * html/HTMLMediaElement.h: Declare waitForSourceChange.
+
 2010-01-19  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Adam Treat.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 5d90a58..84ae688 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -524,9 +524,7 @@ void HTMLMediaElement::loadNextSourceChild()
     ContentType contentType("");
     KURL mediaURL = selectNextSourceChild(&contentType, Complain);
     if (!mediaURL.isValid()) {
-        // It seems wrong to fail silently when we give up because no suitable <source>
-        // element can be found and set the error attribute if the element's 'src' attribute
-        // fails, but that is what the spec says.
+        waitForSourceChange();
         return;
     }
 
@@ -605,6 +603,18 @@ void HTMLMediaElement::startProgressEventTimer()
     m_progressEventTimer.startRepeating(0.350);
 }
 
+void HTMLMediaElement::waitForSourceChange()
+{
+    stopPeriodicTimers();
+    m_loadState = WaitingForSource;
+
+    // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_NO_SOURCE value
+    m_networkState = NETWORK_NO_SOURCE;
+
+    // 6.18 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
+    m_delayingTheLoadEvent = false;
+}
+
 void HTMLMediaElement::noneSupported()
 {
     stopPeriodicTimers();
@@ -695,6 +705,9 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
             m_currentSourceNode->scheduleErrorEvent();
             if (havePotentialSourceChild())
                 scheduleNextSourceChild();
+            else
+                waitForSourceChange();
+
             return;
         }
 
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 4288c45..3e9ae2a 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -230,6 +230,7 @@ private:
     void noneSupported();
     void mediaEngineError(PassRefPtr<MediaError> err);
     void cancelPendingEventsAndCallbacks();
+    void waitForSourceChange();
 
     enum InvalidSourceAction { DoNothing, Complain };
     bool isSafeToLoadURL(const KURL&, InvalidSourceAction);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list