Commit 45abe121 authored by Sriram's avatar Sriram Committed by Commit Bot

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

This reverts commit e6b16d30.

Reason for revert: https://crbug.com/824746

Original change's description:
> 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/753102
> Reviewed-by: Fredrik Söderquist <fs@opera.com>
> Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
> Cr-Commit-Position: refs/heads/master@{#513819}

TBR=fs@opera.com,srirama.m@samsung.com

# Not skipping CQ checks because the original CL landed 4 months ago.

Bug: 551245
Change-Id: Ic0fa56ae68b11332f6e0336c290290f434c7df3c
Reviewed-on: https://chromium-review.googlesource.com/1004974
Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
Reviewed-by: default avatarsrirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#549503}
parent de7c257b
......@@ -3042,6 +3042,8 @@ crbug.com/472300 external/wpt/html/semantics/embedded-content/media-elements/int
crbug.com/472300 external/wpt/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html [ Failure ]
crbug.com/472300 external/wpt/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html [ Failure ]
crbug.com/825798 external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-non-snap-to-lines.html [ Failure ]
crbug.com/803951 external/wpt/html/browsers/history/the-location-interface/reload_post_1.html [ Failure Timeout ]
crbug.com/651778 external/wpt/workers/Worker_cross_origin_security_err.htm [ Timeout ]
......
......@@ -193,6 +193,25 @@ void VTTCueBox::ApplyCSSProperties(
// text alignment:
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.
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