Bug 33744 - video.networkState remains NETWORK_LOADING indefinitely when no <source> element was able to be loaded
Summary: video.networkState remains NETWORK_LOADING indefinitely when no <source> elem...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Eric Carlson
Keywords: InRadar
Depends on:
Reported: 2010-01-15 14:29 PST by Adam Roben (:aroben)
Modified: 2010-01-19 11:33 PST (History)
1 user (show)

See Also:

test case (458 bytes, text/html)
2010-01-18 06:24 PST, Adam Roben (:aroben)
no flags Details
Proposed patch (5.75 KB, patch)
2010-01-19 10:01 PST, Eric Carlson
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2010-01-15 14:29:38 PST
To reproduce:

1. Download the attached test case to LayoutTests/media
2. run-webkit-tests media/media-no-source-networkState.html

The test fails because video.networkState has remained NETWORK_LOADING even though we failed to load the one and only <source> element.

HTML5 says networkState should be NETWORK_NO_SOURCE at this point. See <http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#concept-media-load-algorithm> step 6.17:

> ⌛ Waiting: Set the element's networkState attribute to the NETWORK_NO_SOURCE value.

Note that <video src=doesnotexist.mp4> does not have this bug.
Comment 1 Adam Roben (:aroben) 2010-01-15 14:30:13 PST
Comment 2 Adam Roben (:aroben) 2010-01-15 14:36:40 PST
I think we need to set m_networkState here <http://trac.webkit.org/browser/trunk/WebCore/html/HTMLMediaElement.cpp?rev=53146#L692>:

        // If we failed while trying to load a <source> element, the movie was never parsed, and there are more
        // <source> children, schedule the next one
        if (m_readyState < HAVE_METADATA && m_loadState == LoadingFromSourceElement) {
            if (havePotentialSourceChild())
Comment 3 Adam Roben (:aroben) 2010-01-15 14:36:57 PST
This seems related to bug 33735.
Comment 4 Eric Carlson 2010-01-16 14:10:59 PST
Looks like you forgot to attach the test case.
Comment 5 Adam Roben (:aroben) 2010-01-18 06:24:26 PST
Created attachment 46817 [details]
test case

(I think there's something buggy with adding an attachment to a bug that you are just creating (i.e., using the "Add Attachment" form on the Create Bug page).)
Comment 6 Eric Carlson 2010-01-19 10:01:40 PST
Created attachment 46921 [details]
Proposed patch
Comment 7 Adam Roben (:aroben) 2010-01-19 10:13:42 PST
Comment on attachment 46921 [details]
Proposed patch

Your test seems to indicate that this fixes bug 33735, too. Is that true?

Comment 8 Eric Carlson 2010-01-19 11:33:44 PST