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

Add showPicker to <select> elements #9754

Merged
merged 9 commits into from
Nov 16, 2023
39 changes: 39 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -52758,6 +52758,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
boolean <span data-x="dom-cva-reportValidity">reportValidity</span>();
undefined <span data-x="dom-cva-setCustomValidity">setCustomValidity</span>(DOMString error);

undefined <span data-x="dom-select-showPicker">showPicker</span>();

readonly attribute <span>NodeList</span> <span data-x="dom-lfe-labels">labels</span>;
};</code></pre>
</dd>
Expand Down Expand Up @@ -53085,6 +53087,21 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {

<p>Can be set, to change the selection.</p>
</dd>

<dt><code data-x=""><var>select</var>.<span subdfn data-x="dom-select-showPicker">showPicker</span>()</code></dt>

<dd>
<p>Shows any applicable picker UI for <var>select</var>, so that the user can select a value.

<p>Throws an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> if
<var>select</var> is not <span data-x="concept-fe-mutable">mutable</span>.</p>

<p>Throws a <span>"<code>NotAllowedError</code>"</span> <code>DOMException</code> if called
without <span data-x="transient activation">transient user activation</span>.</p>

<p>Throws a <span>"<code>SecurityError</code>"</span> <code>DOMException</code> if
<var>select</var> is inside a cross-origin <code>iframe</code>.</p>
</dd>
</dl>

<div w-nodev>
Expand All @@ -53095,6 +53112,27 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
data-x="">select-multiple</code>" if the <code data-x="attr-select-multiple">multiple</code>
attribute is present.</p>
lukewarlow marked this conversation as resolved.
Show resolved Hide resolved

<p>The <dfn method for="HTMLSelectElement"><code
data-x="dom-select-showPicker">showPicker()</code></dfn> method steps are:</p>
lukewarlow marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>If <span>this</span> is not <span data-x="concept-fe-mutable">mutable</span>, then throw
an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li>
<p>If <span>this</span>'s <span>relevant settings object</span>'s <span
data-x="concept-settings-object-origin">origin</span> is not <span>same origin</span> with
<span>this</span>'s <span>relevant settings object</span>'s <span>top-level origin</span>, then throw a
<span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p>
</li>

<li><p>If <span>this</span>'s <span>relevant global object</span> does not have <span>transient
activation</span>, then throw a <span>"<code>NotAllowedError</code>"</span>
<code>DOMException</code>.</p></li>

<li><p>Show the picker, if applicable, for <span>this</span>.</p></li>
</ol>

<p>The <dfn attribute for="HTMLSelectElement"><code
data-x="dom-select-options">options</code></dfn> IDL attribute must return an
<code>HTMLOptionsCollection</code> rooted at the <code>select</code> node, whose filter matches
Expand Down Expand Up @@ -139684,6 +139722,7 @@ INSERT INTERFACES HERE
Lucas Gadani,
&#x0141;ukasz Pilorz,
Luke Kenneth Casson Leighton,
Luke Warlow,
Luke Wilde,
Maciej Stachowiak,
Magne Andersson,
Expand Down