Skip to content

Commit 95d3a2d

Browse files
authored
[selectors-4] Define a number of new pseudo-classes for matching the state of media elements. (#6219)
* [selectors-4] First draft of :seeking, :buffering, :stalled, :muted, and :volume-locked pseudo-classes. * Use link-defaults instead of anchors for several terms defined in HTML. * Remove unnecessary comment and fix whitespace.
1 parent 2298ae4 commit 95d3a2d

File tree

1 file changed

+50
-5
lines changed

1 file changed

+50
-5
lines changed

selectors-4/Overview.bs

+50-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ spec:css-pseudo-4; type:selector;
3535
text: ::after
3636
text: ::first-line
3737
text: ::first-letter
38+
spec:HTML; type:dfn;
39+
text: effective media volume
40+
text: seeking
41+
text: media data
42+
text: stall timeout
3843
</pre>
3944

4045
<style>
@@ -2404,22 +2409,62 @@ Resource State Pseudos</h2>
24042409
and allow authors to select them based on some quality of their state.
24052410

24062411
<h3 id="video-state">
2407-
Video/Audio Play State: the '':playing'' and '':paused'' pseudo-classes</h3>
2412+
Media Playback State: the '':playing'', '':paused'', and '':seeking'' pseudo-classes</h3>
24082413

24092414
The <dfn>:playing</dfn> pseudo-class represents an element
2410-
representing an audio, video, or similar resource
24112415
that is capable of being “played” or “paused”,
24122416
when that element is “playing”.
24132417
(This includes both when the element is explicitly playing,
24142418
and when it's temporarily stopped for some reason not connected to user intent,
24152419
but will automatically resume when that reason is resolved,
2416-
such as a “buffering” state.)
2420+
such as a “buffering” or “stalled” state.)
24172421

2418-
The <dfn>:paused</dfn> pseudo-class represents the same elements,
2419-
but instead match when the element is <em>not</em> “playing”.
2422+
The <dfn>:paused</dfn> pseudo-class represents an element
2423+
that is capable of being “played” or “paused”,
2424+
when that element is “paused” (i.e. <em>not</em> ”playing”).
24202425
(This includes both an explicit “paused” state,
24212426
and other non-playing states like “loaded, hasn't been activated yet”, etc.)
24222427

2428+
The <dfn>:seeking</dfn> pseudo-class represents an element
2429+
that is capable of ”seeking”
2430+
when that element is ”seeking”.
2431+
(For the <{audio}> and <{video}> elements of HTML, see [[HTML#seeking]].)
2432+
2433+
<h3 id="media-loading-state">
2434+
Media Loading State: the '':buffering'' and '':stalled'' pseudo-classes</h3>
2435+
2436+
The <dfn>:buffering</dfn> pseudo-class represents an element
2437+
that is capable of being “played” or “paused”,
2438+
when that element cannot continue playing
2439+
because it is actively attempting to obtain [=media data=]
2440+
but has not yet obtained enough data to resume playback.
2441+
(Note that the element is still considered to be “playing” when it is “buffering”.
2442+
Whenever '':buffering'' matches an element,
2443+
'':playing'' also matches the element.)
2444+
2445+
The <dfn>:stalled</dfn> pseudo-class represents an element
2446+
when that element cannot continue playing
2447+
because it is actively attempting to obtain [=media data=]
2448+
but it has failed to receive any data for some amount of time.
2449+
For the <{audio}> and <{video}> elements of HTML,
2450+
this amount of time is the [=stall timeout=]. [[HTML]]
2451+
(Note that, like with the '':buffering'' pseudo-class,
2452+
the element is still considered to be “playing” when it is “stalled”.
2453+
Whenever '':stalled'' matches an element,
2454+
'':playing'' also matches the element.)
2455+
2456+
<h3 id="sound-state">
2457+
Sound State: the '':muted'' and '':volume-locked'' pseudo-classes</h3>
2458+
2459+
The <dfn>:muted</dfn> pseudo-class represents
2460+
an element capable of making sound
2461+
when that element is “muted“.
2462+
(For the <{audio}> and <{video}> elements of HTML, see [=muted=]. [[HTML]])
2463+
2464+
The <dfn>:volume-locked</dfn> pseudo-class represents
2465+
an element capable of making sound
2466+
when programmatically changing the element’s volume
2467+
does not change the element's [=effective media volume=].
24232468

24242469
<h2 id='input-pseudos'>
24252470
The Input Pseudo-classes</h2>

0 commit comments

Comments
 (0)