Bug 223242

Summary: Set media elements' networkState to NETWORK_IDLE if the connection is interrupted
Product: WebKit Reporter: Souju TANAKA <sojulibra>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: calvaris, cdumez, changseok, don.olmstead, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Souju TANAKA 2021-03-16 00:46:10 PDT
Media elements' networkState should be NETWORK_IDLE if the connection is interrupted after some media data has been received, according to spec: https://html.spec.whatwg.org/#loading-the-media-resource

The actual state is NETWORK_EMPTY. I confirmed it on GTK MiniBrowser by opening a test page and disable network interface after the media element starts loading.
https://codepen.io/souju/pen/oNgmGRq

I guess the code was based on W3C editor's draft and has been left unchanged.
https://dev.w3.org/html5/pf-summary/video.html
Comment 1 Souju TANAKA 2021-03-16 02:08:09 PDT
Created attachment 423309 [details]
Patch
Comment 2 Eric Carlson 2021-03-16 08:53:21 PDT
Comment on attachment 423309 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423309&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:2108
> +    // 3 - Set the element's networkState attribute to the NETWORK_IDLE value.

Please include a link to the spec section these comments are taken from (https://html.spec.whatwg.org/#loading-the-media-resource:dom-media-have_nothing-2) to make it easier to see when something changes in the future.
Comment 3 Souju TANAKA 2021-03-16 20:43:23 PDT
Created attachment 423428 [details]
Patch
Comment 4 Souju TANAKA 2021-03-16 22:05:03 PDT
Created attachment 423434 [details]
Patch
Comment 5 EWS 2021-03-17 08:20:59 PDT
Committed r274559: <https://commits.webkit.org/r274559>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423434 [details].
Comment 6 Radar WebKit Bug Importer 2021-03-17 08:22:14 PDT
<rdar://problem/75527057>