Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -56161,13 +56161,19 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
</div>

<div algorithm>
<p>To get the <dfn data-x="concept-select-option-list">list of options</dfn> given a
<code>select</code> element <var>select</var>:</p>
<p>The <dfn data-x="concept-select-option-list">list of options</dfn> for a
<code>select</code> element <var>select</var> is the result of running <span>descendant
<code>option</code> elements</span> given <var>select</var>.</p>
</div>

<div algorithm>
<p>To get the <dfn>descendant <code>option</code> elements</dfn> of an <span data-x="HTML
elements">HTML element</span> <var>element</var>:</p>

<ol>
<li><p>Let <var>options</var> be « ».</p></li>

<li><p>Let <var>node</var> be the <span>first child</span> of <var>select</var> in <span>tree
<li><p>Let <var>node</var> be the <span>first child</span> of <var>element</var> in <span>tree
order</span>.</p></li>

<li>
Expand All @@ -56188,14 +56194,14 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
<li><p><var>node</var> is an <code>option</code> element;</p></li>

<li><p><var>node</var> is an <code>optgroup</code> element and <var>node</var> has an
<span>ancestor</span> <code>optgroup</code> in between itself and <var>select</var>,</p></li>
</ul>
<span>ancestor</span> <code>optgroup</code> in between itself and
<var>element</var>,</p></li> </ul>
Comment on lines 56196 to +56198
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running these steps for an optgroup element, the second check should be skipped, right? Otherwise options in optgroup in optgroup will be returned by the outer optgroup's "descendant option elements".


<p>then set <var>node</var> to the next <span>descendant</span> of <var>select</var> in
<p>then set <var>node</var> to the next <span>descendant</span> of <var>element</var> in
<span>tree order</span>, excluding <var>node</var>'s <span
data-x="descendant">descendants</span>, if any such node exists; otherwise null.</p>

<p>Otherwise, set <var>node</var> to the next <span>descendant</span> of <var>select</var> in
<p>Otherwise, set <var>node</var> to the next <span>descendant</span> of <var>element</var> in
<span>tree order</span>, if any such node exists; otherwise null.</p>
</li>
</ol>
Expand Down Expand Up @@ -56825,12 +56831,13 @@ interface <dfn interface>HTMLOptGroupElement</dfn> : <span>HTMLElement</span> {
<dd w-dev>Uses <code>HTMLOptGroupElement</code>.</dd>
</dl>

<p>The <code>optgroup</code> element <span>represents</span> a group of <code>option</code>
elements with a common label.</p>
<p>The <code>optgroup</code> element <span>represents</span> a <span data-x="optgroup's group of
option elements">group of <code>option</code> elements</span> with a common label.</p>

<div algorithm>
<p>The element's group of <code>option</code> elements consists of the <code>option</code>
elements that are children of the <code>optgroup</code> element.</p>
<p>An <dfn><code>optgroup</code>'s group of <code>option</code> elements</dfn>, given an
<code>optgroup</code> element <var>optgroup</var>, is the result of running <span>descendant
<code>option</code> elements</span> given <var>optgroup</var>.</p>
</div>

<div w-nodev>
Expand All @@ -56843,8 +56850,8 @@ interface <dfn interface>HTMLOptGroupElement</dfn> : <span>HTMLElement</span> {

<p>The <dfn element-attr for="optgroup"><code
data-x="attr-optgroup-disabled">disabled</code></dfn> attribute is a <span>boolean
attribute</span> and can be used to <span data-x="concept-option-disabled">disable</span> a group
of <code>option</code> elements together.</p>
attribute</span> and can be used to <span data-x="concept-option-disabled">disable</span> an
<span><code>optgroup</code>'s group of <code>option</code> elements</span> together.</p>

<p>The <dfn element-attr for="optgroup"><code data-x="attr-optgroup-label">label</code></dfn>
attribute must be specified if the <code>optgroup</code> has no child <code>legend</code>
Expand Down