Skip to content

Commit bf3a706

Browse files
authored
Editorial: simplify (re)moving steps of form-associated elements
Both the removing steps and moving steps are invoked for all nodes in a removed or moved tree, so the recursion implied by "or the ancestor of" isn't needed. This better matches implementations, and seems to be unobservable now that mutation events don't exist and no other JavaScript code runs during these steps.
1 parent 8035a25 commit bf3a706

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

source

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,17 +1837,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
18371837
run the corresponding <span>HTML element removing steps</span> given <var>removedNode</var> and
18381838
<var>oldParent</var>.</p></li>
18391839

1840-
<li>
1841-
<p>If <var>removedNode</var> is a <span>form-associated element</span> or the ancestor of a
1842-
<span>form-associated element</span>, then:</p>
1843-
1844-
<ol>
1845-
<li><p>If the <span>form-associated element</span> has a <span>form owner</span> and the
1846-
<span>form-associated element</span> and its <span>form owner</span> are no longer in the same
1847-
<span>tree</span>, then <span>reset the form owner</span> of the <span>form-associated
1848-
element</span>.</p></li>
1849-
</ol>
1850-
</li>
1840+
<li><p>If <var>removedNode</var> is a <span>form-associated element</span> with a non-null
1841+
<span>form owner</span> and <var>removedNode</var> and its <span>form owner</span> are no longer
1842+
in the same <span>tree</span>, then <span>reset the form owner</span> of
1843+
<var>removedNode</var>.</p></li>
18511844

18521845
<li><p>If <var>removedNode</var>'s <code data-x="attr-popover">popover</code> attribute is not in
18531846
the <span data-x="attr-popover-none-state">No Popover</span> state, then run the <span>hide
@@ -1864,17 +1857,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
18641857
data-x="concept-element-local-name">local name</span>, then run the corresponding <span>HTML
18651858
element moving steps</span> given <var>movedNode</var>.</p></li>
18661859

1867-
<li>
1868-
<p>If <var>movedNode</var> is a <span>form-associated element</span> or the ancestor of a
1869-
<span>form-associated element</span>, then:</p>
1870-
1871-
<ol>
1872-
<li><p>If the <span>form-associated element</span> has a <span>form owner</span> and the
1873-
<span>form-associated element</span> and its <span>form owner</span> are no longer in the same
1874-
<span>tree</span>, then <span>reset the form owner</span> of the <span>form-associated
1875-
element</span>.</p></li>
1876-
</ol>
1877-
</li>
1860+
<li><p>If <var>movedNode</var> is a <span>form-associated element</span> with a non-null
1861+
<span>form owner</span> and <var>movedNode</var> and its <span>form owner</span> are no longer in
1862+
the same <span>tree</span>, then <span>reset the form owner</span> of
1863+
<var>movedNode</var>.</p></li>
18781864
</ol>
18791865

18801866
<p>A <dfn id="insert-an-element-into-a-document" data-x="node is inserted into a document"

0 commit comments

Comments
 (0)