Skip to content

Commit 30c2607

Browse files
authored
Use empty string for reflection of Element(s) IDL attributes
Using the ID of the element led to surprising results in a number of edge cases. Tests: web-platform-tests/wpt#36253. Fixes #8306
1 parent 627ee28 commit 30c2607

File tree

1 file changed

+4
-53
lines changed

1 file changed

+4
-53
lines changed

source

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7831,23 +7831,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
78317831
</ol>
78327832
</li>
78337833

7834-
<li><p>Let <var>id</var> be the empty string.</p></li>
7835-
7836-
<li>
7837-
<p>If the given value:</p>
7838-
7839-
<ul class="brief">
7840-
<li>has the same <span>root</span> as <span>this</span>, and</li>
7841-
<li>has an <code data-x="attr-id">id</code> attribute, and</li>
7842-
<li>is the first element in <span>this</span>'s <span>node tree</span> whose <span
7843-
data-x="concept-ID">ID</span> is the value of that <code data-x="attr-id">id</code>
7844-
attribute,</li>
7845-
</ul>
7846-
7847-
<p>then set <var>id</var> to the given value's <span data-x="concept-ID">ID</span>.</p>
7848-
</li>
7849-
7850-
<li><p>Set the content attribute's value for <span>this</span> to <var>id</var>.</p></li>
7834+
<li><p>Set the content attribute's value for <span>this</span> to the empty string.</p></li>
78517835

78527836
<li><p>Set <span>this</span>'s <span>explicitly set <var>attr</var>-element</span> to a weak
78537837
reference to the given value.</p></li>
@@ -7994,52 +7978,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
79947978
</ol>
79957979
</li>
79967980

7997-
<li><p>Let <var>value</var> be an empty string.</p></li>
7981+
<li><p>Set the content attribute's value for <span>this</span> to the empty string.</p></li>
7982+
7983+
<li><p>Let <var>elements</var> be an empty <span>list</span>.</p></li>
79987984

79997985
<li>
80007986
<p><span data-x="list iterate">For each</span> <var>element</var> in the given value:</p>
80017987

80027988
<ol>
8003-
<li>
8004-
<p>If <var>value</var> is empty and <var>elements</var> is non-empty, then:</p>
8005-
8006-
<ol>
8007-
<li><p><span data-x="list append">Append</span> a weak reference to <var>element</var>
8008-
to <var>elements</var>.</p></li>
8009-
8010-
<li><p><span>Continue</span>.</p></li>
8011-
</ol>
8012-
</li>
8013-
80147989
<li><p><span data-x="list append">Append</span> a weak reference to <var>element</var> to
80157990
<var>elements</var>.</p></li>
8016-
8017-
<li>
8018-
<p>If <var>element</var>:</p>
8019-
8020-
<ul class="brief">
8021-
<li>does not have the same <span>root</span> as <span>this</span>, or</li>
8022-
<li>has no <code data-x="attr-id">id</code> attribute, or</li>
8023-
<li>is not the first element in <span>this</span>'s <span>node tree</span> whose <span
8024-
data-x="concept-ID">ID</span> is the value of that <code data-x="attr-id">id</code>
8025-
attribute,</li>
8026-
</ul>
8027-
8028-
<p>then set <var>value</var> to the empty string, and <span>continue</span>.</p>
8029-
</li>
8030-
8031-
<li><p>Let <var>id</var> be <var>element</var>'s <span
8032-
data-x="concept-ID">ID</span>.</p></li>
8033-
8034-
<li><p>If <var>value</var> is not the empty string, then append U+0020 SPACE to
8035-
<var>value</var>.</p></li>
8036-
8037-
<li><p>Append <var>id</var> to <var>value</var>.</p></li>
80387991
</ol>
80397992
</li>
80407993

8041-
<li><p>Set the content attribute's value for <span>this</span> to <var>value</var>.</p></li>
8042-
80437994
<li><p>Set <span>this</span>'s <span>explicitly set <var>attr</var>-elements</span> to
80447995
<var>elements</var>.</p></li>
80457996
</ol>

0 commit comments

Comments
 (0)