HTML: Add tests for resource selection and moving nodes#60466
Open
zcorpan wants to merge 2 commits into
Open
Conversation
6 tasks
zcorpan
commented
Jun 8, 2026
zcorpan
commented
Jun 12, 2026
|
|
||
| window.onload = t.step_func(function() { | ||
| assert_equals(a, 1, 'error events on a'); | ||
| assert_equals(b, 1, 'error events on b'); |
Member
Author
There was a problem hiding this comment.
I think this is correct per spec, but we could change the spec to stop firing error events on moved or removed source elements (at least if the parent is no longer the original media element).
Comment on lines
+26
to
+27
| videoBr.moveBefore(document.getElementById('br-node'), document.getElementById('br-c')); | ||
| videoText.moveBefore(document.getElementById('text-holder').firstChild, document.getElementById('text-c')); |
Member
There was a problem hiding this comment.
This is running before that the resource selection algorithm actually starts iterating through the children, since it's happening synchronously right? While the resource selection algorithm starts by awaiting a stable state.
It would be good to assert what the networkState is at this point.
If that's right, is this test actually testing what it's meant to? If the algorithm is not done awaiting for the stable state yet, then we've not initialized the pointer yet.
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.
See whatwg/html#12511
(I used ChatGPT to help write these tests.)