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 the :open pseudo-class #10126

Merged
merged 17 commits into from
Dec 10, 2024
Merged
34 changes: 31 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -48169,6 +48169,11 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
data-x="attr-input-type-checkbox">Checkbox</span> state) stop an <code>input</code> element from
being <i data-x="concept-fe-mutable">mutable</i>.</p>

<p>Some states of the <code data-x="attr-input-type">type</code> attribute <dfn
data-x="input-support-picker">support a picker</dfn>, which is a popup that allows the user to
choose a value. Which states <span data-x="input-support-picker">support a picker</span> is up to
the user agent.</p>
annevk marked this conversation as resolved.
Show resolved Hide resolved

<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>input</code> elements
must propagate the <span data-x="concept-fe-value">value</span>, <span
data-x="concept-fe-dirty">dirty value flag</span>, <span
Expand Down Expand Up @@ -52636,8 +52641,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<dt><code data-x=""><var>input</var>.<span subdfn data-x="dom-input-showPicker">showPicker</span>()</code></dt>

<dd>
<p>Shows any applicable picker UI for <var>input</var>, so that the user can select a value. (If
no picker UI is implemented for the given control, then this method does nothing.)</p>
<p>If <var>input</var> does not <span data-x="input-support-picker">support a picker</span>,
this method does nothing.</p>

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

<p>Throws an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> if
<var>input</var> is not <span data-x="concept-fe-mutable">mutable</span>.</p>
Expand Down Expand Up @@ -53010,7 +53017,8 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<li>
<p>Otherwise, the user agent should show any relevant user interface for selecting a value for
<var>element</var>, in the way it normally would when the user interacts with the control. (If
no such UI applies to <var>element</var>, then this step does nothing.)</p>
<var>element</var> does not <span data-x="input-support-picker">support a picker</span>, then
this step does nothing.)</p>

<p>If such a user interface is shown, it must respect the requirements stated in the relevant
parts of the specification for how <var>element</var> behaves given its <code
Expand Down Expand Up @@ -74795,6 +74803,26 @@ Demos:
<dd><p>The <code data-x="selector-volume-locked">:volume-locked</code> <span>pseudo-class</span>
must match all <span data-x="media element">media elements</span> when the user agent's
<span>volume locked</span> is true.</p></dd>

<dt><dfn selector><code data-x="selector-open">:open</code></dfn></dt>
<dd>
<p>An <code>Element</code> matches the <code data-x="selector-open">:open</code>
<span>pseudo-class</span> if it matches one of the following:</p>

<ol>
<li><p>A <code>details</code> element which has the <code
data-x="attr-details-open">open</code> attribute.</p></li>

<li><p>A <code>dialog</code> element which has the <code data-x="attr-dialog-open">open</code>
attribute.</p></li>

<li><p>A <code>select</code> element which is a <span>drop-down box</span> whose drop-down box
is open.</p></li>

<li><p>An <code>input</code> element which <span data-x="input-support-picker">supports a
picker</span> popup and whose picker popup is open.</p></li>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
</ol>
</dd>
</dl>

<p class="note">This specification does not define when an element matches the <code undefined
Expand Down