Commit e6b16d30 authored by Sriram's avatar Sriram Committed by Commit Bot

Remove old position adjustment for non-snap-to-lines WebVTT cues

This is a remnant of what the spec originally said. Just like the bug
report says, this turned out to be pretty confusing:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19178

Bug: 551245
Change-Id: I1063b940db81555a65211fa93e84441b53e2b091
Reviewed-on: https://chromium-review.googlesource.com/753102Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#513819}
parent 65c2ce1c
<!DOCTYPE html>
<title>Reference test for track-webvtt-non-snap-to-lines.html.</title>
<script src="../media-file.js"></script>
<style>
.container {
position: relative;
display: inline-block;
}
.cue {
position: absolute;
top: 48px;
font-family: sans-serif;
background: green;
color: rgba(255, 255, 255, 1);
font-size: 12px;
padding: 0px 2px;
}
</style>
<div class="container">
<video>
<script>
document.currentScript.parentNode.src = findMediaFile('video', '../content/test');
</script>
</video>
<span class="cue">Bear is Coming!!!!!</div>
</div>
<!DOCTYPE html>
<title>Tests that position is not adjusted for non snap-to-lines cues.</title>
<style>
::cue {
background: green;
}
</style>
<script src="../media-file.js"></script>
<video></video>
<script>
var video = document.querySelector("video");
var track = video.addTextTrack("captions");
var cue = new VTTCue(0, 1, "Bear is Coming!!!!!");
cue.snapToLines = false;
cue.line = 20;
cue.align = "left";
track.addCue(cue);
track.mode = "showing";
video.src = findMediaFile("video", "../content/test");
</script>
\ No newline at end of file
...@@ -193,27 +193,6 @@ void VTTCueBox::ApplyCSSProperties( ...@@ -193,27 +193,6 @@ void VTTCueBox::ApplyCSSProperties(
// text alignment: // text alignment:
SetInlineStyleProperty(CSSPropertyTextAlign, display_parameters.text_align); SetInlineStyleProperty(CSSPropertyTextAlign, display_parameters.text_align);
// TODO(foolip): The position adjustment for non-snap-to-lines cues has
// been removed from the spec:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=19178
if (std::isnan(display_parameters.snap_to_lines_position)) {
// 10.13.1 Set up x and y:
// Note: x and y are set through the CSS left and top above.
// 10.13.2 Position the boxes in boxes such that the point x% along the
// width of the bounding box of the boxes in boxes is x% of the way
// across the width of the video's rendering area, and the point y%
// along the height of the bounding box of the boxes in boxes is y%
// of the way across the height of the video's rendering area, while
// maintaining the relative positions of the boxes in boxes to each
// other.
SetInlineStyleProperty(CSSPropertyTransform,
String::Format("translate(-%.2f%%, -%.2f%%)",
position.X(), position.Y()));
SetInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePre);
}
// The snap-to-lines position is propagated to LayoutVTTCue. // The snap-to-lines position is propagated to LayoutVTTCue.
snap_to_lines_position_ = display_parameters.snap_to_lines_position; snap_to_lines_position_ = display_parameters.snap_to_lines_position;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment