Re: [csswg-drafts] [selectors-4] "effective media volume is mutable" pseudo-class for media elements (#3933)

The CSS Working Group just discussed `“effective media volume is mutable” pseudo-class for media elements`, and agreed to the following:

* `RESOLVED: Add :volume-locked.`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: “effective media volume is mutable” pseudo-class for media elements<br>
&lt;heycam> https://github.com/w3c/csswg-drafts/issues/3933<br>
&lt;heycam> hober: this one is similar to the other cases.  it's a bit weird though<br>
&lt;heycam> ... in the HTMl spec, media elements have a volume.  which you can set from JS<br>
&lt;heycam> ... can also be set by native controls<br>
&lt;heycam> ... if you look at the algorithm for determining what the effective volume is, there is a clause that is a short circuit that allows for platform conventions to be followed<br>
&lt;heycam> ... at least one case where this matters, on iOS, there is no software controlled volume<br>
&lt;heycam> ... it can'tb e chnaged from script.  you can change it on the element, but that clause applies<br>
&lt;AmeliaBR> q+ to ask about fingerprinting potential<br>
&lt;heycam> ... so we short circuit at step 1 of that algorithm<br>
&lt;heycam> ... this is a feature that users like.  they have control of volume, pages can't screw with that<br>
&lt;heycam> ... I think there's another impl that does this?  can't remember<br>
&lt;heycam> ... people are doing UA sniffing to hide the volume button in media controls on iOS<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/3933<br>
&lt;heycam> ... I'd rather then be able to know that the effective volume won't be affected by the JS prop<br>
&lt;heycam> ... the other difference is I don't know what to name this<br>
&lt;TabAtkins> q+<br>
&lt;florian> q+<br>
&lt;heycam> ... the HTML spec doesn't have a name for it<br>
&lt;jensimmons> `volume-effectiveness`?<br>
&lt;dbaron> :can-control-volume ?<br>
&lt;heycam> AmeliaBR: before the name, I want to confirm this is uncontroversial.  not exposing new information?<br>
&lt;RRSAgent> logging to https://www.w3.org/2019/06/04-css-irc<br>
&lt;heycam> ... currently, if you set the volume from script, and it doesn't work, you can tell?<br>
&lt;heycam> hober: yes<br>
&lt;fremy> @hober: `:user-locked-volume` ?<br>
&lt;heycam> AmeliaBR: if I mute the whole laptop, is that included in this?<br>
&lt;heycam> hober: I don't know if system muted state on desktop OS affects that<br>
&lt;heycam> ... if it did, I would expect it to affect this<br>
&lt;chris> rrsagent, here<br>
&lt;RRSAgent> See https://www.w3.org/2019/06/04-css-irc#T14-04-21<br>
&lt;heycam> AmeliaBR: either way there's a clear defn in HTML?  and it's already exposed to script?<br>
&lt;heycam> hober: yes<br>
&lt;heycam> hober: AmeliaBR proposed :adjustable-volume.  so it's the opposite of that<br>
&lt;jensimmons> q+<br>
&lt;heycam> TabAtkins: :volume-locked<br>
&lt;heycam> ... expresses the semantic that you'd style on, doesn't need :not()<br>
&lt;heycam> ... but given other suggestion for a volume pseudo, you could merge this into a pseudo that takes a keyword<br>
&lt;TabAtkins> https://www.irccloud.com/pastebin/rPsIGCzk/<br>
&lt;heycam> hober: on Windows, muted and volume are independent states<br>
&lt;heycam> :volume( locked || muted || &lt;volume-value> )<br>
&lt;heycam> &lt;volume-value> = [ '&lt;' | '>' ] '='? [ &lt;number [0,1]> | &lt;percentage [0%,100%]> ]<br>
&lt;fremy> +1 on TabAtkins's proposal<br>
&lt;astearns> ack florian<br>
&lt;heycam> florian: I don't think this varies per element.  maybe a MQ is better?<br>
&lt;heycam> hober: I think the use case is tied to media controls<br>
&lt;heycam> florian: but you can't have one media element which is locked and one is not?<br>
&lt;Rossen_> q+ fremy<br>
&lt;heycam> hober: I think it makes sense to be symmetric with the other pseudos<br>
&lt;heycam> ... but I concede the point it's a system wide thing<br>
&lt;fremy> q-<br>
&lt;Rossen_> ack jensimmons<br>
&lt;heycam> jensimmons: a few quick examples in the thread<br>
&lt;TabAtkins> :volume(locked &lt; 50%), for example<br>
&lt;dbaron> s/a few/request a few/<br>
&lt;heycam> hober: of Tab's syntax, or when you would use this?<br>
&lt;TabAtkins> :volume(muted)<br>
&lt;heycam> jensimmons: when you'd use it<br>
&lt;florian> q+<br>
&lt;hober> div.controls:volume(locked) .volume { display: none; }<br>
&lt;heycam> TabAtkins: for :volume(locked), you'd display:none your custom volume button<br>
&lt;heycam> AmeliaBR: should the pseudo refer to the fact that the volume control works or wouldn't work<br>
&lt;heycam> hober: my case is for the latter<br>
&lt;TabAtkins> `video:volume(locked) + .controls > .volume { display: none; }`<br>
&lt;heycam> ... shouldn't display if it's going to be futile<br>
&lt;Rossen_> q?<br>
&lt;heycam> fremy: if you set vol to 0, that stil lmutes the video?<br>
&lt;heycam> hober: depends on the platform<br>
&lt;heycam> ... not on Windows.  unmuted at volumnet 0<br>
&lt;heycam> hober: on iOS you can mute audio tracks on media elements<br>
&lt;heycam> fremy: using volume 0?<br>
&lt;heycam> hober: using .muted<br>
&lt;heycam> chris: when you unmute you want to go back to the old volume<br>
&lt;heycam> florian: for this one and the prev one, wondering if this is practical as a pseudo, given the controls aren't usually a descendant<br>
&lt;heycam> hober: it's often a sibling<br>
&lt;Rossen_> ack florian<br>
&lt;heycam> hober: that's the same as the existing :play / :paused pseudos<br>
&lt;heycam> hober: I really like Tab's locked suggestion.  either as the one off or the general proposal<br>
&lt;heycam> ... since we resolved on :muted.  I'm happy to resolve on :volume-locked, and discuss merging later<br>
&lt;heycam> AmeliaBR: for the parenthesized idea, volume(max/min) might also be useful<br>
&lt;heycam> TabAtkins: are min/max different from 0% / 100%?<br>
&lt;heycam> AmeliaBR: do we want to expose %s in a selector?<br>
&lt;heycam> emilio: we don't have any other pseudos with numeric values inside them<br>
&lt;heycam> hober: I think it's a good argument for going with the one off for now<br>
&lt;heycam> RESOLVED: Add :volume-locked.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3933#issuecomment-498689912 using your GitHub account

Received on Tuesday, 4 June 2019 14:13:56 UTC