[csswg-drafts] [css-cascade] Cascade layers vs. VTT STYLE blocks (#6735)

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

== [css-cascade] Cascade layers vs. VTT STYLE blocks ==
(Not sure if I should file it here or webvtt...)

WebVTT files can embed stylesheets in [`STYLE` blocks](https://www.w3.org/TR/webvtt/#styling) to style video captions.

Regarding the relation with cascade layers, there are some issues to be resolved:
1. What's the cascade precedence of `STYLE` blocks with layers taken into consideration?
2. Can we define layers within `STYLE` blocks?

My understanding is that `STYLE` blocks are similar to the `style` attribute in the sense that they only apply to one specific element. So defining layers in `STYLE` blocks doesn't make sense in the same way as it doesn't make sense in the `style` attribute. And for the same reason the cascade precedence should be the same as the `style` attribute.

So my proposal is:
1. `STYLE` blocks do not belong to any layer. They are cascaded with the same precedence as the `style` attribute (i.e., author origin & same tree scope as the `<track>` element), and the source order precedes the `style` attribute<sup>[1]</sup>
2. `@layer` rules and layered `@import` rules in `STYLE` blocks should be invalid and ignored.

[1] The current WebVTT spec is pretty vague about the cascade precedence, just [saying](https://www.w3.org/TR/webvtt1/#obtaining-css-boxes) `STYLE` blocks are after all other stylesheets in the document in terms of the order of appearance. I think this should be refined, though, but it's probably a different issue.


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 15 October 2021 18:27:06 UTC