Skip to content

Commit

Permalink
Update content model for customizable select
Browse files Browse the repository at this point in the history
This PR updated the content model for the <select>, <option>, and
<optgroup> elements in support of customizable <select>.

Fixes #10317
  • Loading branch information
josepharhar committed Aug 28, 2024
1 parent 8c74909 commit 088b919
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -12785,6 +12785,34 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
</ul>


<h6>Select element inner content elements</h6>

<p><dfn>Select element inner content elements</dfn> are <code>option</code> elements and other
elements which are used to group and decorate them with a <code>select</code> element.</p>

<p>The following are <span>select element inner content elements</span>:</p>

<ul class="brief category-list">
<li><code>option</code> elements.</li>

<li><code>optgroup</code> elements.</li>

<li><code>hr</code> elements.</li>

<li><span>script-supporting elements</span>.</li>

<li><code>noscript</code> elements.</li>

<li><code>div</code> elements.</li>

<li><code>span</code> elements.</li>

<li><code>img</code> elements.</li>

<li><span>SVG <code>svg</code></span> elements.</li>
</ul>



<h5>Transparent content models</h5>

Expand Down Expand Up @@ -53203,7 +53231,8 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>phrasing content</span> is expected.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd>Zero or more <code>option</code>, <code>optgroup</code>, <code>hr</code>, and <span data-x="script-supporting elements">script-supporting</span> elements.</dd>
<dd>Zero or more <span>select element inner content elements</span>.</dd>
<dd>Zero or one child <code>button</code>.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-fe-autocomplete">autocomplete</code></dd>
Expand Down Expand Up @@ -53932,9 +53961,9 @@ interface <dfn interface>HTMLDataListElement</dfn> : <span>HTMLElement</span> {
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd>None.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>As a child of a <code>select</code> element.</dd>
<dd>As a descendant of a <code>select</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd>Zero or more <code>option</code> and <span data-x="script-supporting elements">script-supporting</span> elements.</dd>
<dd>Zero or more <span>select element inner content elements</span>.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-optgroup-disabled">disabled</code></dd>
Expand Down Expand Up @@ -54029,17 +54058,15 @@ interface <dfn interface>HTMLOptGroupElement</dfn> : <span>HTMLElement</span> {
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd>None.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>As a child of a <code>select</code> element.</dd>
<dd>As a descendant of a <code>select</code> element.</dd>
<dd>As a child of a <code>datalist</code> element.</dd>
<dd>As a child of an <code>optgroup</code> element.</dd>
<dd>As a descendant of an <code>optgroup</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd>If the element has a <code data-x="attr-option-label">label</code> attribute and a <code data-x="attr-option-value">value</code> attribute: <span data-x="concept-content-nothing">Nothing</span>.</dd>
<dd>If the element has a <code data-x="attr-option-label">label</code> attribute but no <code data-x="attr-option-value">value</code> attribute: <span data-x="text content">Text</span>.</dd>
<dd>If the element has no <code data-x="attr-option-label">label</code> attribute and is not a
child of a <code>datalist</code> element: <span data-x="text content">Text</span> that is not
<span>inter-element whitespace</span>.</dd>
<dd>If the element has no <code data-x="attr-option-label">label</code> attribute and is a child
of a <code>datalist</code> element: <span data-x="text content">Text</span>.</dd>
<dd>If the element has no <code data-x="attr-option-label">label</code> attribute: <span>Text content</span> and zero or more <code>div</code>, <code>span</code>, <code>noscript</code>, <code>img</code>, <span>SVG <code>svg</code></span>, and <span data-x="script-supporting elements">script-supporting</span> elements.</dd>
<dd><div class="note">If an <code>img</code> is used within an <code>option</code> and there is no other text within the <code>option</code>, then the <code>option</code> won't have an accessible name unless the <code>img</code> also has a non-empty <code data-x="attr-img-alt">alt</code> attribute.</div></dd>

<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-option-disabled">disabled</code></dd>
Expand Down

0 comments on commit 088b919

Please sign in to comment.