Skip to content

Commit b64559c

Browse files
authored
Update an attribute's node document
When an attribute is appended to an element or is replacing an existing attribute, we need to ensure that its node document remains accurate. Tests: web-platform-tests/wpt#50835. Fixes #1359.
1 parent cbf4c0d commit b64559c

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

dom.bs

+17-10
Original file line numberDiff line numberDiff line change
@@ -6553,6 +6553,9 @@ steps:
65536553

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

6556+
<li><p>Set <var>attribute</var>'s <a for=Node>node document</a> to <var>element</var>'s
6557+
<a for=Node>node document</a>.
6558+
65566559
<li><p><a>Handle attribute changes</a> for <var>attribute</var> with <var>element</var>, null, and
65576560
<var>attribute</var>'s <a for=Attr>value</a>.
65586561
</ol>
@@ -6573,19 +6576,23 @@ steps:
65736576
</ol>
65746577

65756578
<p>To <dfn export id=concept-element-attributes-replace lt="replace an attribute">replace</dfn> an
6576-
<a>attribute</a> <var>oldAttr</var> with an <a>attribute</a> <var>newAttr</var>, run these steps:
6579+
<a>attribute</a> <var>oldAttribute</var> with an <a>attribute</a> <var>newAttribute</var>:
65776580

65786581
<ol>
6579-
<li><p><a for=list>Replace</a> <var>oldAttr</var> by <var>newAttr</var> in <var>oldAttr</var>'s
6580-
<a for=Attr>element</a>'s <a for=Element>attribute list</a>.
6582+
<li><p>Let <var>element</var> be <var>oldAttribute</var>'s <a for=Attr>element</a>.</p></li>
6583+
6584+
<li><p><a for=list>Replace</a> <var>oldAttribute</var> by <var>newAttribute</var> in
6585+
<var>element</var>'s <a for=Element>attribute list</a>.
65816586

6582-
<li><p>Set <var>newAttr</var>'s <a for=Attr>element</a> to <var>oldAttr</var>'s
6583-
<a for=Attr>element</a>.
6587+
<li><p>Set <var>newAttribute</var>'s <a for=Attr>element</a> to <var>element</var>.
6588+
6589+
<li><p>Set <var>newAttribute</var>'s <a for=Node>node document</a> to <var>element</var>'s
6590+
<a for=Node>node document</a>.
65846591

6585-
<li><p>Set <var>oldAttr</var>'s <a for=Attr>element</a> to null.
6592+
<li><p>Set <var>oldAttribute</var>'s <a for=Attr>element</a> to null.
65866593

6587-
<li><p><a>Handle attribute changes</a> for <var>oldAttr</var> with <var>newAttr</var>'s
6588-
<a for=Attr>element</a>, <var>oldAttr</var>'s <a for=Attr>value</a>, and <var>newAttr</var>'s
6594+
<li><p><a>Handle attribute changes</a> for <var>oldAttribute</var> with <var>element</var>,
6595+
<var>oldAttribute</var>'s <a for=Attr>value</a>, and <var>newAttribute</var>'s
65896596
<a for=Attr>value</a>.
65906597
</ol>
65916598

@@ -7473,15 +7480,15 @@ to as <em>content attributes</em> to avoid confusion with IDL attributes.
74737480

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

7476-
When an <a>attribute</a> is created, its
7483+
<p>When an <a>attribute</a> is created, its
74777484
<a for=Attr>local name</a> is given. Unless explicitly
74787485
given when an <a>attribute</a> is created, its
74797486
<a for=Attr>namespace</a>,
74807487
<a for=Attr>namespace prefix</a>, and
74817488
<a for=Attr>element</a> are set to null, and its
74827489
<a for=Attr>value</a> is set to the empty string.
74837490

7484-
An
7491+
<p>An
74857492
<dfn export id=concept-named-attribute lt="named attribute"><code><var>A</var></code> attribute</dfn>
74867493
is an <a>attribute</a> whose
74877494
<a for=Attr>local name</a> is

0 commit comments

Comments
 (0)