@@ -10932,6 +10933,17 @@ partial interface Document {
set of not restored reason details,
initially empty.
+
Each Document has a state-preserving atomic move in progress boolean, which is initially
+ false.
+
+
This is set by moveBefore() when a
+ Document is performing a state-preserving atomic move; it is used to exempt certain
+ insertion steps and removing steps (and their kin), from running, if they
+ would ordinarily reset state that needs to be preserved.
+
The DocumentOrShadowRoot interface
DOM defines the state-preserving atomic move
+ in progress is true, then return.
+
If insertedNode's parent is a media element that has no src attribute and whose networkState has the value HTMLSourceElement : HTMLElement {
steps, given removedNode and oldParent, are:
+
If insertedNode's node document's state-preserving atomic move
+ in progress is true, then return.
+
If removedNode's next sibling was an img element and
oldParent is a picture element, then, count this as a relevant mutation for the img element.
If target's state-preserving atomic move
+ in progress is true, then return.
+
If target is not fully active, then return.
If target's active sandboxing flag set has the
@@ -138774,6 +138782,10 @@ interface HTMLFrameSetElement : HTMLElement {
insertedNode, are:
+
If insertedNode's node document's state-preserving atomic move
+ in progress is true, then return.
+
If insertedNode is not in a document tree, then return.
If insertedNode's root's HTMLFrameSetElement : HTMLElement {
The frameHTML element removing steps, given removedNode,
- are to destroy a child navigable given removedNode.
+ are:
+
+
+
If insertedNode's node document's state-preserving atomic move
+ in progress is true, then return.
+
+
Destroy a child navigable given removedNode.
+
Whenever a frame element with a non-null content navigable has its
src attribute set, changed, or removed, the user
From cbae5b240d1c27c3a05c5c907a4c004775dfabc8 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
Date: Sun, 29 Sep 2024 23:40:11 -0400
Subject: [PATCH 03/24] Add HTML element moving steps override
---
source | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/source b/source
index 07310a4a8df..bf943e74554 100644
--- a/source
+++ b/source
@@ -1773,8 +1773,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x="control">controls or U+0020 SPACE).
An HTML element can have specific HTML element insertion steps, HTML element
- post-connection steps, and HTML element removing steps, all defined for the
- element's local name.
+ post-connection steps, HTML element removing steps, and HTML element moving
+ steps all defined for the element's local
+ name.
The insertion steps for the HTML Standard, given
insertedNode, are defined as the following:
@@ -1861,6 +1862,31 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
popover algorithm given removedNode, false, false, and false.
+
The moving steps for the HTML Standard, given
+ movedNode, are defined as the following:
+
+
+
If movedNode is an element whose namespace is the HTML namespace, and this
+ standard defines HTML element moving steps for movedNode's local name, then run the corresponding HTML
+ element moving steps given movedNode.
+
+
+
If movedNode is a form-associated element or the ancestor of a
+ form-associated element, then:
+
+
+
If the form-associated element's parser inserted flag is set,
+ then return.
+
+
Reset the form owner of the form-associated element.
+
+
+
+
+
+
A node is inserted into a
document when the insertion steps are invoked
@@ -3264,6 +3290,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The insertion steps,
The post-connection steps,
removing steps,
+ moving steps,
adopting steps, and
children changed steps hooks for elements
The change, append, remove, replace, get an attribute by namespace and local name, set value, and remove an attribute by namespace and local name algorithms for attributes
From 749d57de0b75ebf24622e926b6a2c236863476c0 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
Date: Mon, 30 Sep 2024 00:13:35 -0400
Subject: [PATCH 04/24] media + option + optgroup
---
source | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/source b/source
index bf943e74554..d30656b9e12 100644
--- a/source
+++ b/source
@@ -36620,13 +36620,15 @@ interface MediaError {
other node is the node after pointer. Initially, let pointer be the position between the candidate node and the
next node, if there are any, or the end of the list, if it is the last node.
-
As nodes are inserted and removed into the media element,
+
As nodes are inserted, removed, and movedinto the media element,
pointer must be updated as follows:
-
If a new node is inserted between the two
- nodes that define pointer
+
If a new node is inserted or moved between the two nodes that define
+ pointer
Let pointer be the point between the node before pointer and the new node. In other words, insertions at pointer go after pointer.
The optgroupHTML element moving steps, given movedNode
+ and oldParent, are:
+
+
+
Run the optgroupHTML element removing steps given
+ movedNode and oldParent.
+
+
If an option element in the list of
options asks for a reset, then run that
select element's selectedness setting algorithm.
From 80edc73043ea9bf5e7b16e34ccc0f6961f0a48aa Mon Sep 17 00:00:00 2001
From: Dominic Farolino
Date: Mon, 30 Sep 2024 00:18:00 -0400
Subject: [PATCH 05/24] Revert most or all usages of state-preserving atomic
move in progress flag
---
source | 56 +++++++-------------------------------------------------
1 file changed, 7 insertions(+), 49 deletions(-)
diff --git a/source b/source
index d30656b9e12..9b2fe82c025 100644
--- a/source
+++ b/source
@@ -10971,6 +10971,9 @@ partial interface Document {
data-x="concept-node-remove-ext">removing steps (and their kin), from running, if they
would ordinarily reset state that needs to be preserved.
+
TODO(domfarolino): Before merging, probably remove this flag since we're going with
+ the HTML element moving steps infrastructure instead.
+
The DocumentOrShadowRoot interface
DOM defines the state-preserving atomic move
- in progress is true, then return.
-
If insertedNode's parent is a media element that has no src attribute and whose networkState has the value HTMLSourceElement : HTMLElement {
steps, given removedNode and oldParent, are:
-
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
If removedNode's next sibling was an img element and
oldParent is a picture element, then, count this as a relevant mutation for the img element.
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
If insertedNode's parent is a picture element, then, count this as
a relevant mutation for
insertedNode.
@@ -29501,10 +29492,6 @@ interface HTMLImageElement : HTMLElement {
steps, given removedNode and oldParent, are:
-
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
If oldParent is a picture element, then, count this as a
relevant mutation for removedNode.
@@ -31005,9 +30992,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...
The img or sourceHTML element insertion steps or
HTML element removing steps count the mutation as a relevant mutation, when the element's node document's state-preserving atomic move
- in progress is false.
+ mutations">relevant mutation.
The element's parent is a picture element and a source element
that is a previous sibling has its srcset, HTMLIFrameElement : HTMLElement {
The iframeHTML element removing steps, given
- removedNode, are:
-
-
-
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
-
Destroy a child navigable given removedNode.
-
+ removedNode, are to destroy a child navigable given
+ removedNode.
This happens without any unload events firing
(the element's content document is state-preserving atomic move
- in progress is true, then return.
-
Ensure details exclusivity by closing the given element if needed given
insertedNode.
If target's state-preserving atomic move
- in progress is true, then return.
-
If target is not fully active, then return.
If target's active sandboxing flag set has the
@@ -138830,10 +138800,6 @@ interface HTMLFrameSetElement : HTMLElement {
insertedNode, are:
-
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
If insertedNode is not in a document tree, then return.
If insertedNode's root's HTMLFrameSetElement : HTMLElement {
The frameHTML element removing steps, given removedNode,
- are:
-
-
-
If insertedNode's node document's state-preserving atomic move
- in progress is true, then return.
-
-
Destroy a child navigable given removedNode.
-
+ are to destroy a child navigable given removedNode.
Whenever a frame element with a non-null content navigable has its
src attribute set, changed, or removed, the user
From 9be6d21372be53e7a22c0f6912bc98972a373c8c Mon Sep 17 00:00:00 2001
From: Dominic Farolino
Date: Mon, 30 Sep 2024 00:19:05 -0400
Subject: [PATCH 06/24] Spacing
---
source | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source b/source
index 9b2fe82c025..b6a08135ea2 100644
--- a/source
+++ b/source
@@ -36600,7 +36600,7 @@ interface MediaError {
As nodes are inserted, removed, and movedinto the media element,
+ data-x="concept-node-move-ext">moved into the media element,
pointer must be updated as follows:
A node is inserted into a
document when the insertion steps are invoked
From f8db9426ec42f7c2c17e55582cdd6c12ba263ea5 Mon Sep 17 00:00:00 2001
From: Noam Rosenthal
Date: Wed, 2 Oct 2024 16:48:47 +0100
Subject: [PATCH 08/24] Use move steps instead of the flag
---
source | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/source b/source
index 82d31329e46..c1c48ad657a 100644
--- a/source
+++ b/source
@@ -1872,6 +1872,25 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x="concept-element-local-name">local name, then run the corresponding HTML
element moving steps given movedNode.
+
+
If movedNode is a custom element, then:
+
+
+
If the element has an author-provided connectedMoveCallback, then
+ call it with no arguments.
+
+
+
Otherwise:
+
+
Call movedNode's disconnectedCallback, with no
+ arguments.
+
Call movedNode's connectedCallback, with no
+ arguments.
+
+
+
+
+
If movedNode is a form-associated element or the ancestor of a
form-associated element, then:
From c53b01c80a03fc5b074b522fd2c1a0498a172631 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
Date: Tue, 8 Oct 2024 15:01:16 -0400
Subject: [PATCH 09/24] Add `` and `