-
Notifications
You must be signed in to change notification settings - Fork 686
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
[css-cascade] Cascade layers vs. VTT STYLE blocks #6735
Comments
I think this is really a question for the WebVTT spec, but if they meant for STYLE blocks to have the highest possible precedence (over all other rules in the author style sheet) then yes, they should be mapped to the style attr category in the cascade. Note the wording there was careful to avoid constraining styles to attributes specifically, and talks about “declarations that are attached directly to an element (such as the contents of a style attribute)”, so it's not unreasonable to interpret them that way. Either way, I think WebVTT needs to do the clarifying here. |
I renamed that section to "Element Attached Styles" in 9812597 |
Alright, I'll cross-post to webvtt. |
Regarding the term "Element Attached Styles": Can we somehow clarify that presentational hints are not included here? Because presentational hints are also put directly on the element, but have the lowest priority. This made me confused before. |
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808}
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808}
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808}
…lement-attached style, a=testonly Automatic update from web-platform-tests [@layer] Cascade VTT-embedded style as element-attached style As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808} -- wpt-commits: 20d6038632233d23b144c8f1e1cc02c35665efbf wpt-pr: 31591
@xiaochengh Added a cross-reference in b2110e6 ; let us know if that satisfies the concern? |
…lement-attached style, a=testonly Automatic update from web-platform-tests [@layer] Cascade VTT-embedded style as element-attached style As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808} -- wpt-commits: 20d6038632233d23b144c8f1e1cc02c35665efbf wpt-pr: 31591
b2110e6 LGTM, thanks! |
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808}
As per w3c/csswg-drafts#6735: WebVTT-embedded style has the same cascade precedence as the style attribute. Therefore, important WebVTT-embedded style should take precedence over important author layered style. This patch ensures that. Bug: 1095765 Change-Id: I352ff87294235433bcf006e233a2ca7514d4f990 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3273710 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#940808} NOKEYCHECK=True GitOrigin-RevId: 73d41c9e83bdeab9a732f7deeba1eb5c1d734023
(Not sure if I should file it here or webvtt...)
WebVTT files can embed stylesheets in
STYLE
blocks to style video captions.Regarding the relation with cascade layers, there are some issues to be resolved:
STYLE
blocks with layers taken into consideration?STYLE
blocks?My understanding is that
STYLE
blocks are similar to thestyle
attribute in the sense that they only apply to one specific element. So defining layers inSTYLE
blocks doesn't make sense in the same way as it doesn't make sense in thestyle
attribute. And for the same reason the cascade precedence should be the same as thestyle
attribute.So my proposal is:
STYLE
blocks do not belong to any layer. They are cascaded with the same precedence as thestyle
attribute (i.e., author origin & same tree scope as the<track>
element), and the source order precedes thestyle
attribute[1]@layer
rules and layered@import
rules inSTYLE
blocks should be invalid and ignored.[1] The current WebVTT spec is pretty vague about the cascade precedence, just saying
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.The text was updated successfully, but these errors were encountered: