You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy-loading media elements fire loadstart and reject source candidates before deferring, unlike Chrome #12973
⌛ Set the media element's networkState to NETWORK_LOADING.
⌛ Queue a media element task given the media element to fire an event named loadstart at the media element.
...and in children mode, source candidates are checked and rejected there too:
⌛ If candidate has a type attribute whose value, when parsed as a MIME type (including any codecs described by the codecs parameter, for types that define that parameter), represents a type that the user agent knows it cannot render, then end the synchronous section, and jump down to the failed with elements step below.
If the will lazy load element steps given the media element return true: … Return.
So for a below-viewport loading=lazy video, the spec has networkState at NETWORK_LOADING, loadstart fired, and error fired at any source with an unsupported type, all before the element is ever scrolled into view.
In Chrome Canary, none of that appears to happen while the video is below the viewport: networkState is NETWORK_IDLE by the time the load event fires, and no loadstart or sourceerror events fire. Once the video is scrolled into view, loadstart and the sourceerror fire and the load proceeds. The existing wpt tests video-loading-lazy-to-eager.html and video-loading-lazy-not-rendered.html assert that loadstart doesn't fire while lazy, matching Chrome rather than the spec.
Maybe the lazy check should be earlier in the resource selection algorithm, with the resumption steps covering candidate selection too?
Activity
zcorpan commentedon Sep 21, 2026
@scottjehl
media lazy loading: resource selection deferred at step 12 until the …