From d7b1cca5b19254a9a87928bbd2801e17466fc6fe Mon Sep 17 00:00:00 2001 From: Alastor Wu Date: Thu, 13 Jun 2019 23:30:44 +0000 Subject: [PATCH] Bug 1534888 - part1 : modify wpt '2_cues_overlapping_completely_move_up.html' and '2_cues_overlapping_partially_move_up.html'. r=heycam In order to simulate the line break correctly and robustly, we use
to trigger the line break, instead of using `martin-top` to adjust the box position, which have to specify the actual line box's size. Notice that the line box size is not actullay equal to the font size, it would make the offset really tricky (like moving aroung 9.33px if font is 9px) and not robust. In addtion, as the main purpose of these tests are to check whether the second cue would be moved upward and not overlapped with the first box, we change the line position to `100%`, which can eliminate unnecessary moving. If we set `position:50%` for first box, the first box's top would be aligned to the 50% place height of video rendering area, and the second cue would be put above the first cue, which makes that the reference files have to use more complicated CSS style in order to get the same rendering. But if we put the first cue on the bottom, it's way more easier to write the style for the make-up cue line in the reference files. Differential Revision: https://phabricator.services.mozilla.com/D23272 --HG-- extra : moz-landing-system : lando --- ...es_overlapping_completely_move_up-ref.html | 24 ++++++++----------- ...ues_overlapping_partially_move_up-ref.html | 24 ++++++++----------- .../2_cues_overlapping_completely_move_up.vtt | 4 ++-- .../2_cues_overlapping_partially_move_up.vtt | 4 ++-- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up-ref.html b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up-ref.html index f73008f702a1..efd6531817cd 100644 --- a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up-ref.html +++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up-ref.html @@ -10,26 +10,22 @@ body { margin:0 } position: relative; font-size: 9px; } -#cue1 { +.cue { position: absolute; - top: 50%; + bottom: 0; left: 0; right: 0; - margin-top: -4.5px; - text-align: center + text-align: center; } -#cue2 { - position: absolute; - top: 50%; - left: 0; - right: 0; - margin-top: -13.5px; - text-align: center -} -.cue > span { +.cueText { font-family: Ahem, sans-serif; background: rgba(0,0,0,0.8); color: green; } -
This is a test subtitleThis is another test subtitle
+
+ +
This is another test subtitle
+
This is a test subtitle
+
+
diff --git a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up-ref.html b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up-ref.html index b1a8b3b8e486..595aec0a7245 100644 --- a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up-ref.html +++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up-ref.html @@ -10,26 +10,22 @@ body { margin:0 } position: relative; font-size: 9px; } -#cue1 { +.cue { position: absolute; - top: 50%; + bottom: 0; left: 0; right: 0; - margin-top: -4.5px; - text-align: center + text-align: center; } -#cue2 { - position: absolute; - top: 50%; - left: 0; - right: 0; - margin-top: -13.5px; - text-align: center -} -.cue > span { +.cueText { font-family: Ahem, sans-serif; background: rgba(0,0,0,0.8); color: green; } -
This is a test subtitleThis is another test subtitle
+
+ +
This is another test subtitle
+
This is a test subtitle
+
+
diff --git a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_completely_move_up.vtt b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_completely_move_up.vtt index d4a967924821..1ca56e56f6a8 100644 --- a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_completely_move_up.vtt +++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_completely_move_up.vtt @@ -1,7 +1,7 @@ WEBVTT -00:00:00.000 --> 00:00:05.000 line:50% +00:00:00.000 --> 00:00:05.000 line:100% This is a test subtitle -00:00:01.000 --> 00:00:05.000 line:50% +00:00:01.000 --> 00:00:05.000 line:100% This is another test subtitle diff --git a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_partially_move_up.vtt b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_partially_move_up.vtt index 6c99ce3b1fe1..7160f3791ee0 100644 --- a/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_partially_move_up.vtt +++ b/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/support/2_cues_overlapping_partially_move_up.vtt @@ -1,7 +1,7 @@ WEBVTT -00:00:00.000 --> 00:00:05.000 line:50% +00:00:00.000 --> 00:00:05.000 line:100% This is a test subtitle -00:00:01.000 --> 00:00:05.000 line:49% +00:00:01.000 --> 00:00:05.000 line:99% This is another test subtitle