-
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
Complete draft spec for customizable <select>
#10548
Conversation
8be5f47
to
0bee650
Compare
4691e13
to
bef9083
Compare
34be830
to
fed19dc
Compare
FYI: I am likely going to remove the author-provided datalist and fallback UA button in this PR soon based on recent discussions, which will likely reduce the number of changes and complexity. |
d341596
to
6dab95d
Compare
This PR updated the content model for the <select>, <option>, and <optgroup> elements in support of customizable <select>. Fixes whatwg#10317
6dab95d
to
57e00bf
Compare
source
Outdated
@@ -53203,7 +53306,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> |
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.
According to this content model, the example of following is conforming.
But is that OK?
One or more "option" element should be required as a descendant of "select" element.
Example
<select>
<div>unselectable-text-1</div>
<span>unselectable-text-2</span>
<noscript>unselectable-text-3</noscript>
<hr>
<img src="unselectable-image-1.jpg">
<svg><text>unselectable-image-2</text></svg>
</select>
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.
Good catch.
source
Outdated
<option>Cat</option> | ||
<option>Dog</option> | ||
</datalist> | ||
</select></code></pre> |
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 "datalist" element should be added to "Select element inner content elements" category.
source
Outdated
@@ -53203,7 +53306,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> |
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 "selectedoptionelement" attribute should be added.
@@ -55816,6 +56196,115 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> { | |||
|
|||
</div> | |||
|
|||
<h4>The <dfn element><code>selectedoption</code></dfn> element</h4> | |||
|
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.
Is there no begining block(list of "Categories:", "Contexts in which this element can be used:", "Content model:", "Tag omission in text/html:", "Content attributes:", "Accessibility considerations:" & "DOM interface:") in section of the selectedoption element?
source
Outdated
|
||
<li><code>noscript</code> elements.</li> | ||
|
||
<li><code>div</code> elements.</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.
The following sentences should be added to the bigining block of section of the div element.
Categories:
......
+Select element inner content elements.
Contexts in which this element can be used:
......
+As a child of a select element.
+As a child of a optgroup element.
+As a child of a option element.
If the div element may have option element & optgroup element as child, that fact should be added to "Content model:".
Other element of "Select element inner content elements" should be also.
939fe27
to
04e9fcd
Compare
This patch makes the parser allow additional tags in <select> besides <option>, <optgroup>, and <hr>, mostly by removing the "in select" and "in select in table" parser modes. In order to replicate the behavior where opening a <select> tag within another open <select> tag inserts a </select> close tag, a traversal through the stack of open elements was added which I borrowed from the <button> part of the parser. This will need test changes to be implemented in html5lib. Fixes whatwg#10310
04e9fcd
to
46cddc3
Compare
46cddc3
to
50bf192
Compare
50bf192
to
12edc88
Compare
Should this PR be closed, to avoid confusion? I believe it's been completely superseded by the list at the top of #9799, right? |
Yes I'm not keeping this up to date anymore since I decided to split out the PRs and have slight redundancies |
This is a complete draft spec for customizable
<select>
as proposed here<select>
element #9799I don't intend to merge this PR, but instead to break off pieces of it and make PRs for those. However, feedback is greatly appreciated.
💥 Error: Wattsi server error 💥
PR Preview failed to build. (Last tried on Sep 12, 2024, 10:07 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.