Skip to content

Commit 7a0fbad

Browse files
josepharharlozy219
authored andcommitted
Add the :open pseudo-class
These pseudo-classes are defined in CSS here: https://drafts.csswg.org/selectors-4/#open-state
1 parent 69ef2cf commit 7a0fbad

File tree

1 file changed

+59
-33
lines changed

1 file changed

+59
-33
lines changed

source

Lines changed: 59 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48211,6 +48211,35 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
4821148211
data-x="attr-input-type-checkbox">Checkbox</span> state) stop an <code>input</code> element from
4821248212
being <i data-x="concept-fe-mutable">mutable</i>.</p>
4821348213

48214+
<p>The <code>input</code> element can <dfn data-x="input-support-picker">support a picker</dfn>. A
48215+
picker is a user interface element that allows the end user to choose a value. Whether an
48216+
<code>input</code> element supports a picker depends on the <code
48217+
data-x="attr-input-type">type</code> attribute state and <span>implementation-defined</span>
48218+
behavior. An <code>input</code> element must support a picker when its <code
48219+
data-x="attr-input-type">type</code> attribute is in the <span data-x="attr-input-type-file">File
48220+
Upload</span> state.</p>
48221+
48222+
<div class="note">
48223+
<p>As of the time of this writing, typical browser implementations show such picker UI for:</p>
48224+
48225+
<ul>
48226+
<li><p><code>input</code> elements whose <code data-x="attr-input-type">type</code>
48227+
attributes are in the <span data-x="attr-input-type-date">Date</span>, <span
48228+
data-x="attr-input-type-month">Month</span>, <span data-x="attr-input-type-week">Week</span>,
48229+
<span data-x="attr-input-type-time">Time</span>, <span
48230+
data-x="attr-input-type-datetime-local">Local Date and Time</span>, and <span
48231+
data-x="attr-input-type-color">Color</span> states;</p></li>
48232+
48233+
<li><p><code>input</code> elements in various states that have a <span
48234+
data-x="concept-input-list">suggestions source element</span>;</p></li>
48235+
48236+
<li><p><code>input</code> elements whose <code data-x="attr-input-type">type</code> attribute
48237+
is in the <span data-x="attr-input-type-file">File Upload</span> state; and</p></li>
48238+
48239+
<li><p><code>select</code> elements.</p></li>
48240+
</ul>
48241+
</div>
48242+
4821448243
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>input</code> elements
4821548244
must propagate the <span data-x="concept-fe-value">value</span>, <span
4821648245
data-x="concept-fe-dirty">dirty value flag</span>, <span
@@ -52840,8 +52869,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
5284052869
<dt><code data-x=""><var>input</var>.<span subdfn data-x="dom-input-showPicker">showPicker</span>()</code></dt>
5284152870

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

5284652877
<p>Throws an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> if
5284752878
<var>input</var> is not <span data-x="concept-fe-mutable">mutable</span>.</p>
@@ -53172,6 +53203,9 @@ You cannot submit this form when the field is incorrect.</samp></pre>
5317253203
<li><p><span>Consume user activation</span> given <span>element</span>'s <span>relevant global
5317353204
object</span>.</p></li>
5317453205

53206+
<li><p>If <var>element</var> does not <span data-x="input-support-picker">support a
53207+
picker</span>, then return.</p></li>
53208+
5317553209
<li>
5317653210
<p>If <var>element</var> is an <code>input</code> element and <var>element</var>'s <code
5317753211
data-x="attr-input-type">type</code> attribute is in the <span
@@ -53212,11 +53246,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
5321253246
</li>
5321353247

5321453248
<li>
53215-
<p>Otherwise, the user agent should show any relevant user interface for selecting a value for
53216-
<var>element</var>, in the way it normally would when the user interacts with the control. (If
53217-
no such UI applies to <var>element</var>, then this step does nothing.)</p>
53249+
<p>Otherwise, the user agent should show the relevant user interface for selecting a value for
53250+
<var>element</var>, in the way it normally would when the user interacts with the control.</p>
5321853251

53219-
<p>If such a user interface is shown, it must respect the requirements stated in the relevant
53252+
<p>When showing such a user interface, it must respect the requirements stated in the relevant
5322053253
parts of the specification for how <var>element</var> behaves given its <code
5322153254
data-x="attr-input-type">type</code> attribute state. (For example, various sections describe
5322253255
restrictions on the resulting <span data-x="concept-fe-value">value</span> string.)</p>
@@ -53226,33 +53259,6 @@ You cannot submit this form when the field is incorrect.</samp></pre>
5322653259
firing either <code data-x="event-input">input</code> and <code
5322753260
data-x="event-change">change</code> events, or a <code data-x="event-cancel">cancel</code>
5322853261
event.)</p>
53229-
53230-
<div class="note">
53231-
<p>As of the time of this writing, typical browser implementations show such picker UI for:</p>
53232-
53233-
<ul>
53234-
<li><p><code>input</code> elements whose <code data-x="attr-input-type">type</code>
53235-
attributes are in the <span data-x="attr-input-type-date">Date</span>, <span
53236-
data-x="attr-input-type-month">Month</span>, <span data-x="attr-input-type-week">Week</span>,
53237-
<span data-x="attr-input-type-time">Time</span>, <span
53238-
data-x="attr-input-type-datetime-local">Local Date and Time</span>, and <span
53239-
data-x="attr-input-type-color">Color</span> states;</p></li>
53240-
53241-
<li><p><code>input</code> elements in various states that have a <span
53242-
data-x="concept-input-list">suggestions source element</span>;</p></li>
53243-
53244-
<li><p><code>input</code> elements whose <code data-x="attr-input-type">type</code> attribute
53245-
is in the <span data-x="attr-input-type-file">File Upload</span> state (although those are
53246-
handled via the special case above, instead of by this step); and</p></li>
53247-
53248-
<li><p><code>select</code> elements.</p></li>
53249-
</ul>
53250-
53251-
<p>However, the intent of this step is to trigger <em>any</em> picker UI implementation. So
53252-
for example, if a user agent implemented a password picker UI for the <span
53253-
data-x="attr-input-type-password">Password</span> state, then this method would be expected to
53254-
show that picker UI when called on a password input.</p>
53255-
</div>
5325653262
</li>
5325753263
</ol>
5325853264

@@ -75082,6 +75088,26 @@ Demos:
7508275088
<dd><p>The <code data-x="selector-volume-locked">:volume-locked</code> <span>pseudo-class</span>
7508375089
must match all <span data-x="media element">media elements</span> when the user agent's
7508475090
<span>volume locked</span> is true.</p></dd>
75091+
75092+
<dt><dfn selector><code data-x="selector-open">:open</code></dfn></dt>
75093+
<dd>
75094+
<p>The <code data-x="selector-open">:open</code> <span>pseudo-class</span> must match any
75095+
element falling into one of the following categories:</p>
75096+
75097+
<ul>
75098+
<li><p><code>details</code> elements that have an <code data-x="attr-details-open">open</code>
75099+
attribute</p></li>
75100+
75101+
<li><p><code>dialog</code> elements that have an <code data-x="attr-dialog-open">open</code>
75102+
attribute</p></li>
75103+
75104+
<li><p><code>select</code> elements that are a <span>drop-down box</span> and whose drop-down
75105+
boxes are open</p></li>
75106+
75107+
<li><p><code>input</code> elements that <span data-x="input-support-picker">support a
75108+
picker</span> and whose pickers are open</p></li>
75109+
</ul>
75110+
</dd>
7508575111
</dl>
7508675112

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

0 commit comments

Comments
 (0)