-
Notifications
You must be signed in to change notification settings - Fork 3k
Improve optgroup's list of option elements #11738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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> | ||
|
||
<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> | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this formalized in this algorithmic manner? I think we can just say "descendants" below given the content model restrictions on (Not sure why we use |
||
<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> | ||
|
@@ -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> | ||
|
There was a problem hiding this comment.
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? Otherwiseoption
s inoptgroup
inoptgroup
will be returned by the outeroptgroup
's "descendant option elements".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I pushed a commit which I think handles this. How does it look?