-
Notifications
You must be signed in to change notification settings - Fork 30
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
Suggestions to refine the STYLE block #498
Comments
For 1, I'm not sure that |
While the current spec text allows Also since CSS Cascade Level 5, Element Attached Styles have become an independent sorting criterion in deciding the priority. Since And HTML authors can always try to override non-important styles in the WebVTT file with
|
I'm the current editor but don't have knowledge of when this was implemented. Would love it if @silviapfeiffer could chime in if she remembers anything related to it. Ultimately, as long as changes don't break existing usage (not that I've seen a lot of webvtt styling, let alone STYLE block usage), better alignment with CSS makes sense.
Definitely makes sense for |
I can confirm that the proposed change aligns with what Chromium currently does. Chromium currently treats @eric-carlson What do you think about the proposed change? I saw you reviewed the implementation in WebKit, which treats Firefox doesn't seem to support |
I wrote the I think the intent is conveyed in this example in the spec: https://www.w3.org/TR/webvtt/#example-01d14f75 That is, act as if the rules from the outer document appear first and then the embedded HTH. |
(This issue was originally posted as w3c/csswg-drafts#6735)
I'm requesting the following changes regarding the
STYLE
block:style
attribute.The current spec only says:
If I understand correct, the intention is to make sure
STYLE
blocks should override regular stylesheets in the document. However, the current spec text doesn't take, e.g., specificity into consider, so a regular author style rule with selectorvideo#id::cue
would override a::cue
rule in theSTYLE
block. To match the intention, we should makeSTYLE
blocks in the author origin, in the same tree scope as the<track>
element and has the same precedence as astyle
attribute attached to the element.@layer
rules and layered@import
rules inSTYLE
blocks, or even specify an allowlist of what rules are validSince
STYLE
blocks apply to only one element, it doesn't make sense to define global structures like cascade layers there, in the same way defining layers in thestyle
attribute doesn't make sense. So we shouldn't allow that.To make things more systemic, we may even be more restrictive by specifying an allowlist. My suggestion would be only regular style rules and conditional rules (
@media
,@support
and@container
) are valid. Other rules either don't make sense, or require registering something global (like@font-face
,@keyframes
,@property
etc), which is not well-specified and very hard to support (and at least not supported in Chromium AFAICT).The text was updated successfully, but these errors were encountered: