Skip to content

Handle media <source> moves around the pointer#12511

Open
zcorpan wants to merge 3 commits into
mainfrom
zcorpan/resource-selection-move
Open

Handle media <source> moves around the pointer#12511
zcorpan wants to merge 3 commits into
mainfrom
zcorpan/resource-selection-move

Conversation

@zcorpan

@zcorpan zcorpan commented Jun 2, 2026

Copy link
Copy Markdown
Member

Also define the logic in terms of two variables instead of nodes before and after pointer.

Fixes #12500

(See WHATWG Working Mode: Changes for more details.)


/media.html ( diff )

Also define the logic in terms of two variables instead of nodes before and after pointer.

Fixes #12500
@zcorpan

zcorpan commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

@nicolo-ribaudo

Comment thread source Outdated

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better :) It probably needs WPT tests though, when I checked there was no coverage for moving around the <source> elements.

Comment thread source Outdated
Comment thread source
has a next sibling, then set <var>pointerAfter</var> to that sibling; otherwise, set
<var>pointerAfter</var> to null.</p>

<p>As nodes are <span data-x="concept-node-insert-ext">inserted</span>, <span

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have test coverage here for arbitrary nodes? Surprised we don't use source element insertion/removal/moving steps.

@nicolo-ribaudo nicolo-ribaudo Jun 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised we don't use source element insertion/removal/moving steps.

Agree -- (unless @zcorpan gets to it first!), it's in my "hopefully I'll get to open a PR to it" list from #12502.

We already have source element insertion/removal steps, we just need to extend them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was thinking also we should switch to tracking only the source children, but it's a slightly larger leap for the spec. There are tests at https://wpt.fyi/results/html/semantics/embedded-content/media-elements/loading-the-media-resource?label=experimental&label=master&aligned

Comment thread source Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Inconsistent cross-browser behavior for mutating child <source>s of a <video>

3 participants