Skip to content

load() doesn't actually take precedence over loading=lazy #12975

Description

@zcorpan

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:

  1. Let resumptionSteps be the media element's lazy load resumption steps.
  2. If resumptionSteps is not null:
    1. Set the media element's lazy load resumption steps to null.
    2. Invoke resumptionSteps.
  3. 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

Activity

  1. deleted a comment from on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions