Repository navigation
Lazy loading video & audio: test load method precedence over loading attribute in media elements - #58455
Open
scottjehl wants to merge 4 commits into
Open
Lazy loading video & audio: test load method precedence over loading attribute in media elements#58455scottjehl wants to merge 4 commits into
scottjehl wants to merge 4 commits into
Conversation
Merged
5 tasks done
scottjehl
force-pushed
the
media-element-loading-method-tests
branch
from
March 23, 2026 21:09
6412a97 to
ca53d6e
Compare
Contributor
Author
|
@zcorpan also rebased. |
zcorpan
requested changes
Mar 23, 2026
scottjehl
force-pushed
the
media-element-loading-method-tests
branch
from
April 23, 2026 02:37
ca53d6e to
9e5190a
Compare
zcorpan
requested changes
Sep 21, 2026
Comment on lines
+25
to
+27
| audio.addEventListener("loadstart", t.step_func(() => { | ||
| loadstartFired = true; | ||
| assert_true(loadCalled, "load should have been called"); |
Member
There was a problem hiding this comment.
This is not correct per the current spec, but I filed whatwg/html#12973
Comment on lines
+33
to
+37
| const nonLazyAudio = document.createElement("audio"); | ||
| nonLazyAudio.addEventListener("loadstart", t.step_func(() => { | ||
| assert_false(loadstartFired, "loadstart should not have fired initially"); | ||
| loadCalled = true; | ||
| audio.load(); |
Member
There was a problem hiding this comment.
Each media element has its own media element event task source, so there's no guarantee about relative order of the two loadstart events. Better to drop this and instead wait for load on window and assert readyState is HAVE_NOTHING.
|
|
||
| let loadstartFired = false; | ||
| let loadCalled = false; | ||
| audio.addEventListener("loadstart", t.step_func(() => { |
Member
There was a problem hiding this comment.
Wait for loadedmetadata instead to determine that some data was actually loaded.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These tests are meant to support recent revisions to whatwg/html#11980 that specify the precedence of explicit calls to the
load()method over theloadingattribute.