Skip to content

Commit

Permalink
Update an attribute's node document
Browse files Browse the repository at this point in the history
When an attribute is appended to an element or is replacing an existing attribute, we need to ensure that its node document remains accurate.

Fixes #1359.
  • Loading branch information
annevk committed Feb 18, 2025
1 parent cbf4c0d commit d38f128
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6553,6 +6553,9 @@ steps:

<li><p>Set <var>attribute</var>'s <a for=Attr>element</a> to <var>element</var>.

<li><p>Set <var>attribute</var>'s <a for=Node>node document</a> to <var>element</var>'s
<a for=Node>node document</a>.

<li><p><a>Handle attribute changes</a> for <var>attribute</var> with <var>element</var>, null, and
<var>attribute</var>'s <a for=Attr>value</a>.
</ol>
Expand Down Expand Up @@ -6582,6 +6585,9 @@ steps:
<li><p>Set <var>newAttr</var>'s <a for=Attr>element</a> to <var>oldAttr</var>'s
<a for=Attr>element</a>.

<li><p>Set <var>newAttr</var>'s <a for=Node>node document</a> to <var>oldAttr</var>'s
<a for=Attr>element</a>'s <a for=Node>node document</a>.

<li><p>Set <var>oldAttr</var>'s <a for=Attr>element</a> to null.

<li><p><a>Handle attribute changes</a> for <var>oldAttr</var> with <var>newAttr</var>'s
Expand Down Expand Up @@ -7473,15 +7479,15 @@ to as <em>content attributes</em> to avoid confusion with IDL attributes.

<p class=note>User agents could have this as an internal slot as an optimization.

When an <a>attribute</a> is created, its
<p>When an <a>attribute</a> is created, its
<a for=Attr>local name</a> is given. Unless explicitly
given when an <a>attribute</a> is created, its
<a for=Attr>namespace</a>,
<a for=Attr>namespace prefix</a>, and
<a for=Attr>element</a> are set to null, and its
<a for=Attr>value</a> is set to the empty string.

An
<p>An
<dfn export id=concept-named-attribute lt="named attribute"><code><var>A</var></code> attribute</dfn>
is an <a>attribute</a> whose
<a for=Attr>local name</a> is
Expand Down

0 comments on commit d38f128

Please sign in to comment.