[csswg-drafts] [selectors-4] additional resource state pseudo-classes for media elements (#3821)

hober has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors-4] additional resource state pseudo-classes for media elements ==
In [ยง11 Resource State Pseudos](https://drafts.csswg.org/selectors/#resource-pseudos) we currently have the `:playing` and `:paused` pseudo-classes, which collectively address the use case of a custom "play/pause" media control which should appear as a play button or as a pause button depending on the current play state of the associated media element. A bunch of us (@beccahughes @mounirlamouri @padenot @jyavenard @eric-carlson @jernoble et al.) would like to address several related use cases with additional resource state pseudo-classes:

* Whether or not the media element is [**muted**](https://html.spec.whatwg.org/multipage/media.html#concept-media-muted). Use case: styling a custom muted control. Proposal: mint a `:muted` pseudo-class.
* Whether or not setting [the **volume** IDL attribute](https://html.spec.whatwg.org/multipage/media.html#dom-media-volume) would result in the element's [**effective media volume**](https://html.spec.whatwg.org/multipage/media.html#effective-media-volume) actually changing. Use case: showing or hiding a custom volume control based on whether or not using such a control would actually result in a user-audible change. Proposal: mint a new pseudo-class. Bikeshedding very welcome.
* Whether or not the media element is currently **stalled** (see several paragraphs in the HTML spec starting at ["The **stall timeout** is a"](https://html.spec.whatwg.org/multipage/media.html#stall-timeout). Use case: changing the appearance of a loading progress indicator to indicate that loading is currently stalled. Proposal: mint a `:stalled` pseudo-class.
* Whether or not the media element is currently [**seeking**](https://html.spec.whatwg.org/multipage/media.html#seeking). Use case: a custom seek control can reflect the case where a user is seeking using some other, UA-provided control. Proposal: mint a `:seeking` pseudo-class.

Currently, authors of custom media controls have to do some combination of UA-sniffing and other logic from script in order to handle these cases. Ideally, the appearance of such controls would be expressible in CSS, just as play state currently is.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3821 using your GitHub account

Received on Friday, 12 April 2019 18:13:53 UTC