Skip to content
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

Update content model for customizable select #10586

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
088b919
Update content model for customizable select
josepharhar Jul 16, 2024
16fadde
add legend element to optgroup
josepharhar Sep 5, 2024
3c57a19
Update content models for div and span
josepharhar Sep 16, 2024
e27ea83
combine select element lines
josepharhar Sep 16, 2024
44225a8
update categories
josepharhar Sep 16, 2024
c7deb50
Fix legend and remove note
josepharhar Sep 16, 2024
e4d071c
add todo to duplicate table
josepharhar Sep 16, 2024
fb7ca7a
remove divs
josepharhar Sep 23, 2024
841e6ff
palpable content except for interactive content
josepharhar Sep 23, 2024
c6c208c
replace span with div
josepharhar Sep 26, 2024
0891d73
remove hr from optgroup because parser pr
josepharhar Sep 26, 2024
787e86f
remove images outside options and replace div with span inside option
josepharhar Sep 27, 2024
bfa1c18
remove outdated categories
josepharhar Oct 14, 2024
a4954ad
stuff
josepharhar Oct 15, 2024
15f67ea
phrasing content
josepharhar Oct 18, 2024
93ebe9e
improve element lists
josepharhar Oct 23, 2024
b6cebc4
make div and span equal again
josepharhar Oct 28, 2024
ced6411
Merge branch 'main' into selectcontentmodel
josepharhar Oct 28, 2024
57dced1
update phrasing except interactive
josepharhar Nov 8, 2024
eb42bf6
remove span from optgroup and select
josepharhar Nov 8, 2024
22b839c
reorder otherwise
josepharhar Nov 8, 2024
f40e975
add comment
josepharhar Nov 8, 2024
19c1c04
fix content model for span
josepharhar Nov 8, 2024
aa9436e
re-add datalist cases in option content model
josepharhar Nov 8, 2024
eab0bc6
legend element improvements
josepharhar Nov 22, 2024
7f9cc16
remove redundant phrasing content text
josepharhar Nov 22, 2024
bed729f
option datalist descendant
josepharhar Nov 22, 2024
5059234
Merge branch 'main' into selectcontentmodel
josepharhar Dec 6, 2024
b44ec20
datalist child -> datalist descendant
josepharhar Dec 6, 2024
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
99 changes: 84 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -12927,6 +12927,55 @@ 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 the elements which are allowed as
descendants of <code>select</code> elements.</p>

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

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

<li><code>optgroup</code></li>

<li><code>hr</code></li>

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

<li><code>noscript</code></li>

<li><code>div</code></li>
</ul>

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

<p><dfn>Optgroup element inner content elements</dfn> are the elements which are allowed as
descendants of <code>optgroup</code> elements.</p>

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

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

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

<li><code>noscript</code></li>

<li><code>div</code></li>
</ul>

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

<!-- Explicitly listing datalist and object here are required because they are not listed in
interactive content: https://github.com/whatwg/html/issues/10755 -->

<p><dfn>Option element inner content elements</dfn> are <code>div</code> and <span>phrasing
content</span>, but there must be no descendants which are <code>datalist</code>,
<code>object</code>, or <span>interactive content</span>, and no descendants may have the <code
data-x="attr-tabindex">tabindex</code> attribute specified.</p>



<h5>Transparent content models</h5>

Expand Down Expand Up @@ -19930,6 +19979,7 @@ and is further discussed below.&lt;/div></code></pre>
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Select element inner content elements</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>flow content</span> is expected.</dd>
<dd>As a child of a <code>select</code> element.</dd>
Expand Down Expand Up @@ -21664,12 +21714,18 @@ included with Exhibit B.
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Palpable content</span>.</dd>
<dd><span>Select element inner content elements</span>.</dd>
<dd><span>Optgroup element inner content elements</span>.</dd>
<dd><span>Option element inner content elements</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>flow content</span> is expected.</dd>
<dd>As a child of a <code>dl</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd>If the element is a child of a <code>dl</code> element: one or more <code>dt</code> elements followed by one or more <code>dd</code> elements, optionally intermixed with <span>script-supporting elements</span>.</dd>
<dd>If the element is not a child of a <code>dl</code> element: <span>flow content</span>.</dd>
<dd>Otherwise, if the element is a descendant of an <code>option</code> element: Zero or more <span>option element inner content elements</span>.</dd>
<dd>Otherwise, if the element is a descendant of an <code>optgroup</code> element: Zero or more <span>optgroup element inner content elements</span>.</dd>
<dd>Otherwise, if the element is a descendant of a <code>select</code> element: Zero or more <span>select element inner content elements</span>.</dd>
<dd>Otherwise: <span>flow content</span>.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dt><span
Expand Down Expand Up @@ -24484,7 +24540,8 @@ wormhole connection.&lt;/mark>&lt;/p></code></pre>
<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><span>Phrasing content</span>.</dd>
<dd>If the element is a descendant of an <code>option</code> element: Zero or more <span>option element inner content elements</span>.</dd>
<dd>Otherwise: <span>Phrasing content</span>.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dt><span
Expand Down Expand Up @@ -53385,6 +53442,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<dd><span>Palpable content</span>.</dd>
<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>
<dd>As the first child of a <code>select</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd><span>Phrasing content</span>, but there must be no <span>interactive content</span>
descendant and no descendant with the <code data-x="attr-tabindex">tabindex</code> attribute
Expand Down Expand Up @@ -53601,7 +53659,7 @@ 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 one <code>button</code> element if the <code>select</code> is a <span>drop-down box</span> followed by 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-fe-autocomplete">autocomplete</code></dd>
Expand Down Expand Up @@ -54328,11 +54386,11 @@ interface <dfn interface>HTMLDataListElement</dfn> : <span>HTMLElement</span> {

<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd>None.</dd>
<dd><span>Select element inner content elements</span>.</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 one <code>legend</code> element followed by zero or more <span>optgroup 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 @@ -54425,19 +54483,20 @@ interface <dfn interface>HTMLOptGroupElement</dfn> : <span>HTMLElement</span> {

<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd>None.</dd>
<dd><span>Select element inner content elements</span>.</dd>
<dd><span>Optgroup element inner content elements</span>.</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>
descendant of a <code>datalist</code> element: Zero or more <span>option element inner content
elements</span>.</dd>
<dd>If the element has no <code data-x="attr-option-label">label</code> attribute and is a
descendant of a <code>datalist</code> element: <span data-x="text content">Text</span>.</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 Expand Up @@ -56171,8 +56230,13 @@ interface <dfn interface>HTMLFieldSetElement</dfn> : <span>HTMLElement</span> {
<dd>None.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>As the <span>first child</span> of a <code>fieldset</code> element.</dd>
<dd>As the <span>first child</span> of an <code>optgroup</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
<dd><span>Phrasing content</span>, optionally intermixed with <span>heading content</span>.</dd>
<dd>If the element is the <span>first child</span> of a <code>fieldset</code> element:
<span>Phrasing content</span>, optionally intermixed with <span>heading content</span>.</dd>
<dd>If the element is the <span>first child</span> of an <code>optgroup</code> element:
<span>Phrasing content</span>, but there must be no <span>interactive content</span> and no
descendant with the <code data-x="attr-tabindex">tabindex</code> attribute.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dt><span
Expand All @@ -56195,7 +56259,8 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {

<p>The <code>legend</code> element <span>represents</span> a caption for the rest of the contents
of the <code>legend</code> element's parent <code>fieldset</code> element<span w-nodev>, if
any</span>.</p>
any</span>. Otherwise, if the <code>legend</code> has a parent <code>optgroup</code> element, then
the <code>legend</code> represents the <code>optgroup</code>'s label.</p>

<dl class="domintro">
<dt><code data-x=""><var>legend</var>.<span subdfn data-x="dom-legend-form">form</span></code></dt>
Expand Down Expand Up @@ -63840,6 +63905,8 @@ not-slash = %x0000-002E / %x0030-10FFFF
<dd><span>Metadata content</span>.</dd>
<dd><span>Flow content</span>.</dd>
<dd><span>Phrasing content</span>.</dd>
<dd><span>Select element inner content elements</span>.</dd>
<dd><span>Optgroup element inner content elements</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>In a <code>head</code> element of an <span data-x="HTML documents">HTML document</span>, if there are no ancestor <code>noscript</code> elements.</dd>
<dd>Where <span>phrasing content</span> is expected in <span>HTML documents</span>, if there are no ancestor <code>noscript</code> elements.</dd>
Expand Down Expand Up @@ -141209,6 +141276,8 @@ interface <dfn interface>External</dfn> {
<td><code>HTMLElement</code></td>
</tr>

<!-- TODO update this and other part of this table after the duplicate parts earlier in the spec
are finalized. -->
<tr>
<th><code>select</code></th>
<td>List box control</td>
Expand Down