What is the issue with the HTML Standard?
In #11980 it was decided that explicit load() and play() calls take precedence over loading=lazy, and the PR was revised to invoke the lazy load resumption steps from both. web-platform-tests/wpt#58455 tests that load() starts loading a deferred element.
The load() steps are:
- Let resumptionSteps be the media element's lazy load resumption steps.
- If resumptionSteps is not null:
- Set the media element's lazy load resumption steps to null.
- Invoke resumptionSteps.
- Run the media element load algorithm.
But the media element load algorithm aborts the fetch that step 2 just resumed and invokes the resource selection algorithm again, which reaches the resource fetch algorithm:
If the will lazy load element steps given the media element return true: … Return.
The loading attribute is still in the Lazy state, so the element is parked again. The net effect of load() on a deferred element is abort/emptied events and nothing else.
play() doesn't have this problem, since nothing after its resumption step restarts resource selection.
Chrome Canary appears to match the text as written: load() on a below-viewport loading=lazy video doesn't start loading.
Maybe load() should set a flag that makes the resource fetch algorithm skip the lazy check for that one load?
(Found while investigating #12973.)
@scottjehl
What is the issue with the HTML Standard?
In #11980 it was decided that explicit
load()andplay()calls take precedence overloading=lazy, and the PR was revised to invoke the lazy load resumption steps from both. web-platform-tests/wpt#58455 tests thatload()starts loading a deferred element.The
load()steps are:But the media element load algorithm aborts the fetch that step 2 just resumed and invokes the resource selection algorithm again, which reaches the resource fetch algorithm:
The
loadingattribute is still in the Lazy state, so the element is parked again. The net effect ofload()on a deferred element isabort/emptiedevents and nothing else.play()doesn't have this problem, since nothing after its resumption step restarts resource selection.Chrome Canary appears to match the text as written:
load()on a below-viewportloading=lazyvideo doesn't start loading.Maybe
load()should set a flag that makes the resource fetch algorithm skip the lazy check for that one load?(Found while investigating #12973.)
@scottjehl