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

[selectors-4] clarify when :volume-locked matches #8061

Closed
foolip opened this issue Nov 11, 2022 · 9 comments
Closed

[selectors-4] clarify when :volume-locked matches #8061

foolip opened this issue Nov 11, 2022 · 9 comments
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. selectors-4 Current Work

Comments

@foolip
Copy link
Member

foolip commented Nov 11, 2022

https://w3c.github.io/csswg-drafts/selectors-4/#sound-state defines the :volume-locked pseudo-class as:

The :volume-locked pseudo-class represents an element capable of making sound when programmatically changing the element’s volume does not change the element’s effective media volume.

I wasn't able to parse what this means, and found in web-platform-tests/interop#224 (comment) that there aren't any tests to give clues either.

The answer can be found in #3933 (comment), and it would be great if it was spelled out in the spec that this is about the first step of the definition in HTML:

If the user has indicated that the user agent is to override the volume of the element, then return the volume desired by the user.

@tabatkins
Copy link
Member

Can you clarify what part was confusing? Is it the first bit (shared with the :muted pseudo, so we should rephrase both) or just the second part?

@marcoscaceres
Copy link
Member

What's confusing with the current wording is the: "capable of making sound when programmatically changing the element’s volume...".

Maybe something like:

The :volume-locked pseudo-class represents an media element whose effective media volume cannot be changed programmatically (i.e., it is locked so a system specified volume and can only be changed by the system or manually by the end-user and not via script).

Or... "...where attempting to change the effective media volume through an API has no effect. This is because it's is locked by either the underlying operating system or a user preference." ... and maybe needs a note about accessibility?

@fantasai fantasai added the selectors-4 Current Work label Nov 14, 2022
@dbaron
Copy link
Member

dbaron commented Nov 14, 2022

Perhaps the minimal clarification that would help explain why the current wording says what it says would be to add a comma:

The :volume-locked pseudo-class represents an element capable of making sound, when programmatically changing the element’s volume does not change the element’s effective media volume.

But I agree that some of the other clarifications proposed above would be helpful.

@foolip
Copy link
Member Author

foolip commented Nov 14, 2022

@tabatkins, THB, I actually didn't follow the link to "effective media volume" on my first reading, I just knew this wasn't a "native" concept to HTML media elements, and couldn't recognize a situation where changing the volume doesn't work.

@lilles helped find Intent to Implement and Ship: Implement :playing, :paused pseudo-classes, it turns out part of this was implemented in Blink, but wasn't shipped because the HTML integration doesn't exist.

Defining this in https://html.spec.whatwg.org/#pseudo-classes would be an even better fix.

@marcoscaceres
Copy link
Member

Defining this in https://html.spec.whatwg.org/#pseudo-classes would be an even better fix.

I tend to agree (in addition to modifying the language a bit too).

@tabatkins
Copy link
Member

Ah yeah that sentence is really too complex to go without a comma, at minimum, separating the first half from the second. Absolutely reasonable to have trouble parsing it as-is.

I've just rephrased them both, does the new text work better for you?

The :muted pseudo-class represents
an element that is capable of making sound,
but is currently “muted“ (forced silent).
(For the <{audio}> and <{video}> elements of HTML, see [=muted=]. [[HTML]])

The :volume-locked pseudo-class represents
an element that is capable of making sound,
and currently has its volume "locked"
by the UA or the user,
so the page author cannot change it.
(For the <{audio}> and <{video}> elements of HTML,
see the algorithm for setting the element's [=HTMLMediaElement/effective media volume=]. [[HTML]])

@marcoscaceres
Copy link
Member

The above seems good/clear to me at least 👍. Over to @foolip.

@foolip
Copy link
Member Author

foolip commented Nov 15, 2022

That wording looks good to me! Is it going to be normative or not though? If we define selector matching in https://html.spec.whatwg.org/#pseudo-classes, that would need to take precedence, but if both claim to be normative it's at minimum redundant.

@tabatkins
Copy link
Member

Well, both of the parentheticals just say "see X", without any further clarification of what we're supposed to see or what effect it might have, so they're not making any normative statement at all.

The stuff outside the parenthetical is normative and should be consistent with any future changes to HTML.

@tabatkins tabatkins added Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. labels Dec 9, 2022
jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this issue Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. selectors-4 Current Work
Projects
None yet
Development

No branches or pull requests

5 participants