Handle media <source> moves around the pointer#12511
Conversation
Also define the logic in terms of two variables instead of nodes before and after pointer. Fixes #12500
| to the remaining nodes.</dd> | ||
|
|
||
| <dt>If <var>pointerAfter</var> is <span data-x="concept-node-remove-ext">removed</span> or <span data-x="concept-node-move-ext">moved</span></dt> | ||
| <dd>Set <var>pointerAfter</var> to <var>pointerBefore</var>'s next sibling, if |
There was a problem hiding this comment.
(also in the previous <dd>)
Is it implicit that if pointerBefore has no next sibling, pointerAfter is set to null?
There was a problem hiding this comment.
If pointerBefore had no next sibling, then pointerAfter would be null and it can't be removed or moved.
However, there might not be any children left after removing or moving the only child, so the <span>media element</span>'s first child should account for that.
There was a problem hiding this comment.
What I mean is the case where before the tree modification pointerBefore points to the second-to-last element and pointerAfter points to the last element.
When pointerAfter is removed, pointerBefore does not have a next sibling.
There was a problem hiding this comment.
I see that the definitions of next sibling and previous sibling would cover this, they just need to be xref'ed.
| nodes in their own right. One node is the node before <var>pointer</var>, and the | ||
| other node is the node after <var>pointer</var>. Initially, let <var>pointer</var> be the position between the <var>candidate</var> node and the | ||
| next node, if there are any, or the end of the list, if it is the last node.</p> | ||
| <p>⌛ Let <var>pointerBefore</var> and <var>pointerAfter</var> be two variables that |
There was a problem hiding this comment.
| <p>⌛ Let <var>pointerBefore</var> and <var>pointerAfter</var> be two variables that | |
| <p>⌛ Let <var>pointerBefore</var> and <var>pointerAfter</var> |
| 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 |
There was a problem hiding this comment.
We have test coverage here for arbitrary nodes? Surprised we don't use source element insertion/removal/moving steps.
There was a problem hiding this comment.
|
|
||
| <li><p>⌛ If the node after <var>pointer</var> is a <code>source</code> element, | ||
| let <var>candidate</var> be that element.</p></li> | ||
| <li><p>⌛ If <var>pointerAfter</var> is a <code>source</code> element, let |
There was a problem hiding this comment.
then set candidate to that element*?
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 )