-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State-preserving atomic move integration #10657
base: main
Are you sure you want to change the base?
Conversation
@@ -72810,7 +72874,10 @@ customElements.define("x-foo", class extends HTMLElement { | |||
<li><p>When it <span>becomes disconnected</span>, its <code data-x="">disconnectedCallback</code> | |||
is called, with no arguments.</p></li> | |||
|
|||
<li><p>When it is <span data-x="concept-node-adopt">adopted</span> into a new document, its <code | |||
<li><p>When it is <span data-x="concept-node-move-ext">moved</span>, its <code | |||
data-x="">connectedMoveCallback</code> is called, with no arguments.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't callback get the old subtree owner as an argument, so that one can know easily where one was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would require holding a reference to the old tree which might be gone by the time the CE callbacks are fired. Perhaps we can consider this as a future enhancement? I think we should be able to do that in a compatible way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you mentioned connectedMoveCallback everywhere connectedCallback is mentioned (and it's relevant).
- https://html.spec.whatwg.org/#custom-element-reactions
- https://html.spec.whatwg.org/#element-definition (this one seems especially important)
- It could do with some examples as well.
This PR is a supplementary PR to whatwg/dom#1307. It provides the HTML-overrides for the DOM Standard's "moving steps" extension, to allow pieces of the HTML Standard to react to atomic DOM moves without the use of the "insertion steps" or "removing steps", which by default, intentionally fail to preserve most state. The changes in this PR are inspired by the audit carried out in https://docs.google.com/document/d/1qfYyvdK4zhzloABKeh0K1lHPm-SpnEcsWEE9UdDuoMk/edit.
Node.prototype.moveBefore
) WebKit/standards-positions#375Node.prototype.moveBefore
) mozilla/standards-positions#1053(See WHATWG Working Mode: Changes for more details.)
/custom-elements.html ( diff )
/embedded-content.html ( diff )
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/images.html ( diff )
/infrastructure.html ( diff )
/media.html ( diff )