-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
base: main
Are you sure you want to change the base?
Conversation
This PR updated the content model for the <select>, <option>, and <optgroup> elements in support of customizable <select>. Fixes whatwg#10317
20549ca
to
088b919
Compare
Is the idea to allow If the former, you need to change the definition of phrasing content to include " If the latter, you need to change the content model if |
source
Outdated
<dd>Zero or more <span>select element inner content elements</span>.</dd> | ||
<dd>Zero or one child <code>button</code>.</dd> |
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.
<dd>Zero or more <span>select element inner content elements</span>.</dd> | |
<dd>Zero or one child <code>button</code>.</dd> | |
<dd>Zero or more <span>select element inner content elements</span>, followed by zero or one | |
<code>button</code> element.</dd> |
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.
The button should probably go first, and I wanted to keep the "zero or one" concept with the button, so I wrote it like this:
<dd>Zero or one <code>button</code> element followed by zero or more <span>select element inner content elements</span>.</dd>
Look good?
source
Outdated
<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> |
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.
Don't have notes in the "element" box, put it further down along with the prose about the content model. The note is also not correct, so maybe it's better to remove it?
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.
I thought this was what @scottaohara suggested, but as per this comment, it sounds like we can add notes and examples as a follow up. I removed the note for now.
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.
besides the placement could you elaborate on what was wrong with the note @zcorpan? i might have phrased it a bit differently, but it seemed to be saying <option><img src=...></option>
would have no accessible name, and that is correct.
h1 elements are not supposed to be part of the content model, so I implemented the div and span switching by pulling out the content models for option and optgroup and using them in div and span. |
source
Outdated
@@ -53203,7 +53280,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 followed by zero or more <span>select element inner content elements</span>.</dd> |
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.
Description of "As first child of select element" should be added to "Contexts in which this element can be used:" of section of "4.10.6 The button element".
In this case, this button element is neither of "Submit Button" state, "Reset Button" state or "Button" state.
Therefore, a fourth state of button element sholud be defined.
In addition, Shouldn't The following sentent be added to section of "4.10.6 The button element"?
If the button element is a fourth state, "popovertarget", "popovertargetaction", "type", "name" and "value" attribute are must not be spedified.
<ul class="brief category-list"> | ||
<li><span>Text content</span>.</li> | ||
|
||
<li><span>Palpable content</span> except for <span>interactive content</span>.</li> |
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.
"Palpable content"
↓
Shouldn't this be limited to "Phrasing content"?
Because the option element is similar to the p element.
@@ -55773,6 +55842,7 @@ 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> |
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 the legend element is first child of an optgroup element, "heading content" doesn't need to be allowed.
This PR updated the content model for the
<select>
,<option>
, and<optgroup>
elements in support of customizable<select>
.Fixes #10317
(See WHATWG Working Mode: Changes for more details.)
/dom.html ( diff )
/embedded-content-other.html ( diff )
/embedded-content.html ( diff )
/form-elements.html ( diff )
/grouping-content.html ( diff )
/index.html ( diff )
/scripting.html ( diff )
/text-level-semantics.html ( diff )