Bug 1571908 - part5 : add wpt 'snap-to-line.html'. r=heycam
authorAlastor Wu <alwu@mozilla.com>
Wed, 21 Aug 2019 07:10:27 +0000
changeset 489132 62ef7c15917a09e8194ecea263f2fcb2a334aa80
parent 489131 9b44d777f09f409725518a507be7a18a7bdd8ed3
child 489133 41ac8d98d5c7fc53832738c66e1661c56d50eb23
push id36465
push userdvarga@mozilla.com
push dateWed, 21 Aug 2019 16:47:43 +0000
treeherdermozilla-central@4ab60925635c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1571908
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1571908 - part5 : add wpt 'snap-to-line.html'. r=heycam Add wpt `snap-to-line.html` to ensure that the cue with `snap-to-line=false` can be placed in correct place. Setting `line` as percentage will make cue's `snap-to-line` to `false` automatically [1], and we also set `position` and `align` to test if we can handle all these attributes well when `snap-to-line` is false. [1] https://www.w3.org/TR/webvtt1/#ref-for-webvtt-cue-snap-to-lines-flag-9 Differential Revision: https://phabricator.services.mozilla.com/D42433
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/snap-to-line.html.ini
testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/snap-to-line-ref.html
testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/snap-to-line.html
testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/snap-to-line.vtt
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/snap-to-line.html.ini
@@ -0,0 +1,5 @@
+[snap-to-line.html]
+  disabled:
+    if (os == "win"): https://bugzilla.mozilla.org/show_bug.cgi?id=1536762
+    if (os == "android"): https://bugzilla.mozilla.org/show_bug.cgi?id=1536762
+  fuzzy: snap-to-line-ref.html:maxDifference=0-2;totalPixels=0-3500
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/snap-to-line-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>Reference for WebVTT rendering, set explicit 'line' and 'position', which will force 'snap-to-line' to false</title>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+<style>
+html { overflow:hidden }
+body { margin:0 }
+.video {
+    display: inline-block;
+    width: 320px;
+    height: 180px;
+    position: relative;
+}
+.cue {
+    position: absolute;
+    top: 90px;
+    left: 160px;
+    text-align: center;
+    font: 20px/1 Ahem;
+}
+.cueText {
+    background: rgba(0,0,0,0.8);
+    color: green;
+}
+</style>
+<div class=video>
+    <div class="cue">
+        <span class="cueText">foo</span>
+    </div>
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/snap-to-line.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>WebVTT rendering, set explicit 'line' and 'position', which will force 'snap-to-line' to false</title>
+<link rel="match" href="snap-to-line-ref.html">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+<style>
+html { overflow:hidden }
+body { margin:0 }
+::cue {
+    font: 20px/1 Ahem;
+    color: green;
+}
+</style>
+<script src="/common/reftest-wait.js"></script>
+<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/snap-to-line.vtt">
+    <script>
+    document.getElementsByTagName('track')[0].track.mode = 'showing';
+    </script>
+</video>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/snap-to-line.vtt
@@ -0,0 +1,5 @@
+WEBVTT
+
+NOTE set line as percentage would make 'snap-to-line' to false
+00:00:00.000 --> 00:00:05.000 align:start position:50%,line-left line:50%,start
+foo