-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Change definition of select element list box and drop-down box rendering #11460
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
Open
josepharhar
wants to merge
8
commits into
whatwg:main
Choose a base branch
from
josepharhar:listbox
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+27
−19
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d4c1255
Change definition of list box and drop-down box rendering
josepharhar eb7b07b
remove multiple restriction on placeholder
josepharhar 3bd2668
Merge remote-tracking branch 'upstream/main' into listbox
josepharhar 4c9c95c
box
josepharhar d781625
remove button, add note
josepharhar fef3495
Merge branch 'main' into listbox
josepharhar d045cf0
Merge branch 'main' into listbox
josepharhar 9b35aa5
make select multiple size=1 platform dependent
josepharhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55977,11 +55977,10 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> { | |
|
|
||
| <div algorithm> | ||
| <p>If a <code>select</code> element has a <code data-x="attr-select-required">required</code> | ||
| attribute specified, does not have a <code data-x="attr-select-multiple">multiple</code> attribute | ||
| specified, and has a <span data-x="concept-select-size">display size</span> of 1; and if the <span | ||
| data-x="concept-option-value">value</span> of the first <code>option</code> element in the | ||
| <code>select</code> element's <span data-x="concept-select-option-list">list of options</span> (if | ||
| any) is the empty string, and that <code>option</code> element's parent node is the | ||
| attribute specified, and has a <span data-x="concept-select-size">display size</span> of 1; and if | ||
| the <span data-x="concept-option-value">value</span> of the first <code>option</code> element in | ||
| the <code>select</code> element's <span data-x="concept-select-option-list">list of options</span> | ||
| (if any) is the empty string, and that <code>option</code> element's parent node is the | ||
| <code>select</code> element (and not an <code>optgroup</code> element), then that | ||
| <code>option</code> is the <code>select</code> element's <dfn>placeholder label option</dfn>.</p> | ||
| </div> | ||
|
|
@@ -147666,11 +147665,14 @@ progress { appearance: auto; }</code></pre> | |
|
|
||
| <p>A <code>select</code> element whose <code data-x="attr-select-multiple">multiple</code> | ||
| attribute is present is <span>expected</span> to render as a multi-select <span>list | ||
| box</span>.</p> | ||
| box</span> if its <span data-x="concept-select-size">display size</span> is greater than 1. If the | ||
| <code>select</code> element has a display size of 1, then it may render as a <span>drop-down | ||
| box</span> if the platform supports it, otherwise as a <span>list box</span>.</p> | ||
|
|
||
| <p>A <code>select</code> element whose <code data-x="attr-select-multiple">multiple</code> | ||
| attribute is absent, and whose <span data-x="concept-select-size">display size</span> is greater | ||
| than 1, is <span>expected</span> to render as a single-select <span>list box</span>.</p> | ||
| attribute is absent, is <span>expected</span> to render as a <span>drop-down box</span> if its | ||
| <span data-x="concept-select-size">display size</span> is 1, or as a <span>list box</span> if its | ||
| <span data-x="concept-select-size">display size</span> is greater than 1.</p> | ||
|
Member
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. Similarly here I think dropping "single-select" is a mistake. |
||
|
|
||
| <div algorithm> | ||
| <p>When the element renders as a <span>list box</span>, it is a <span>devolvable widget</span> | ||
|
|
@@ -147698,16 +147700,14 @@ progress { appearance: auto; }</code></pre> | |
| </ol> | ||
| </div> | ||
|
|
||
| <p>A <code>select</code> element whose <code data-x="attr-select-multiple">multiple</code> | ||
| attribute is absent, and whose <span data-x="concept-select-size">display size</span> is 1, is | ||
| <span>expected</span> to render as an <span>'inline-block'</span> one-line <span>drop-down | ||
| box</span>. The <span>inline size</span> of its <span>intrinsic size</span> is the | ||
| <span>width of the <code>select</code>'s labels</span>. If the <span>'field-sizing'</span> | ||
| property on the element has a <span>computed value</span> of | ||
| <span data-x="field-sizing-content">'content'</span>, the <span>inline size</span> of the | ||
| <span>intrinsic size</span> depends on the shown text. The shown text is typically the label of | ||
| an <code>option</code> of which <span data-x="concept-option-selectedness">selectedness</span> is | ||
| set to true.</p> | ||
| <p>A <code>select</code> element which is being rendered as a <span>drop-down box</span> is | ||
| <span>expected</span> to render as an <span>'inline-block'</span> box. The <span>inline | ||
| size</span> of its <span>intrinsic size</span> is the <span>width of the <code>select</code>'s | ||
| labels</span>. If the <span>'field-sizing'</span> property on the element has a <span>computed | ||
| value</span> of <span data-x="field-sizing-content">'content'</span>, the <span>inline size</span> | ||
| of the <span>intrinsic size</span> depends on the shown text. The shown text is typically the | ||
| label of an <code>option</code> of which <span | ||
| data-x="concept-option-selectedness">selectedness</span> is set to true.</p> | ||
|
|
||
| <div algorithm> | ||
| <p>When the element renders as a <span>drop-down box</span>, it is a <span>devolvable | ||
|
|
@@ -147806,7 +147806,15 @@ progress { appearance: auto; }</code></pre> | |
| <p>The <dfn>width of the <code>select</code>'s labels</dfn> is the wider of the width necessary to | ||
| render the widest <code>optgroup</code>, and the width necessary to render the widest | ||
| <code>option</code> element in the element's <span data-x="concept-select-option-list">list of | ||
| options</span> (including its indent, if any).</p> | ||
| options</span> (including its indent, if any). If the <code>select</code> has the <code | ||
| data-x="attr-select-multiple">multiple</code> attribute and is being rendered as a | ||
| <span>drop-down box</span>, then the width should also be wide enough to accomodate the text | ||
| rendered in the <code>select</code> with any combination of <code>option</code>s selected.</p> | ||
|
|
||
| <p class="note">The <span>width of the <code>select</code>'s labels</span> has an accomodation for | ||
| <code data-x="attr-select-multiple">multiple</code> because some implementations use special text | ||
| to represent multiple options being selected, such as "2 selected." In this case, the select needs | ||
| to be wide enough to render "2 selected" in addition to the individual <code>option</code>s.</p> | ||
| </div> | ||
|
|
||
| <p>If a <code>select</code> element contains a <span>placeholder label option</span>, the user | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 think this is also dropping some nuance. Shouldn't we prefix all the "box" types with "multi-select"? Because a platform might well support a drop-down box, but the question is really if it supports a multi-select drop-down box.