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

[@layer] Cascade VTT-embedded style as element-attached style #31591

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class="reftest-wait">
<title>Embedded Style: Cascade Priority</title>
<link rel="match" href="embedded_style_cascade_priority-ref.html">
<link rel="help" href="https://w3c.github.io/webvtt/#obtaining-css-boxes">
<link rel="help" href="https://drafts.csswg.org/css-cascade-5/#cascade-sort">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<script src="/common/reftest-wait.js"></script>
<style>
/* Embedded important style should take precedence over author important style
regardless of layers, so the cue color should be green. */
@layer {
::cue {
color: red !important;
}
}
</style>
<video width="320" height="180" autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();">
<source src="/media/white.webm" type="video/webm">
<source src="/media/white.mp4" type="video/mp4">
<track src="support/embedded_style_cascade_priority_layer.vtt" default>
</video>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
WEBVTT

NOTE
opacity: 0.5; should apply.
color: green; should apply.
background: green; should apply because multiple STYLE blocks are supported.

STYLE
::cue {
opacity: 0.5;
}
::cue {
color: green !important;
}

STYLE
::cue {
background: green;
}

00:00:00.000 --> 00:00:05.000
<v Voice1>This <i>is</i> a <b>test</b> subtitle

00:00:00.000 --> 00:00:05.000
<v Voice2>Here <i>is</i> a <b>second</b> subtitle