New issue
Advanced search Search tips

Issue 652745 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 551245
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

VTTCue.snapToLines: used correctly? (VTT Captions using the Position attribute don't render in the correct horizontal position)

Reported by seanpjen...@gmail.com, Oct 4 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Using the attached vtt file, watch a video with captions turned on.
2. For seconds 0-4, the captions will show text every 10% across the position attribute, with text aligned to start.
3. 5-9 use text aligned to middle
4. 10-14 use text aligned to end.

What is the expected behavior?
No matter what the align: setting is, the position attribute should be laying out correctly across the video window. The align end seems closest to what I expect start/middle to be, just offsetting based on the text alignment.

What went wrong?
When align:center is set and position is 60%, the caption appears left of where the 50% position is.
When align:left is set, the positions under 30% appear to be scaled in to a curve. 

Did this work before? No 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.143  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
testvtt_position.vtt
2.3 KB Download
align_left_position_inc.png
100 KB View Download
align_center_position_inc.png
106 KB View Download
align_right_position_inc.png
100 KB View Download
Sorry, what happened should be:

When align:middle is set and position is 60%, the caption appears left of where the 50% position is.
When align:start is set, the positions under 30% appear to be scaled in to a curve. 

Cc: wolenetz@chromium.org
Status: Available (was: Unconfirmed)
Confirmed. Seems to be related to using line percentages. For instance, with the original testvtt_position.vtt modified to use numeric lines (not percentages) for align:start, then no curve was observed. (modified vtt attached).
mod-alignstart.vtt
781 bytes Download
Cc: f...@opera.com foolip@chromium.org
Summary: VTTCue.snapToLines: used correctly? (VTT Captions using the Position attribute don't render in the correct horizontal position) (was: VTT Captions using the Position attribute don't render in the correct horizontal position)
Note, one alternative "working" page we had looked at (from johnpallet@): http://ronallo.com/demos/webvtt-cue-settings/ does *not* set the line position as a percentage. If you simulate that by entering the following into devtools console when that page is loaded:

document.querySelector('video').textTracks[0].cues[0].snapToLines = false;

and then slide the "cue settings position" slider on the page left and right, you'll see some interesting behavior. Further, continue switching snapToLines true and false and sliding that position appears to incrementally corrupt the position.

It appears that something in the non-snapToLines positioning is incorrect, if not also snapToLines (either in spec or impl, or both). This bug tracks figuring at least that out now :)

Note, either pixel layout test(s) or unit test(s) would be good to add to verify broken, and eventually fixed VTTCue display parameter calculations in the context of !snapToLines, and also when alternating values of snapToLines.
I think this existing FIXME in LayoutVTTCue, for when !VTTCue.snapToLine, might be the root of the problem:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp?sq=package:chromium&rcl=1475767319&l=285

Comment 6 by f...@opera.com, Oct 7 2016

I suspect what we're seeing here is https://w3c.github.io/webvtt/#apply-webvtt-cue-settings (primarily steps 2 - 5) and the interaction with 'size' (which looks like it's 100% in all these cases.)

The FIXME in LayoutVTTCue is unrelated (that would be substep 4 of the snap-to-lines=false case of step 11), the code to compute the initial positions is in VTTCue::calculateDisplayParameters.

Comment 7 by f...@opera.com, Oct 7 2016

Cc: sim...@opera.com

Comment 8 by f...@opera.com, Oct 7 2016

Forgot to mention: We also have a TODO in VTTCueBox::applyCSSProperties, which is somewhat related to this. We still implement the old align behavior for non-snap-to-lines cues. I wonder if that might be what gives rise to the "curve behavior".

Comment 9 by sim...@opera.com, Sep 14 2017

Cc: -sim...@opera.com zcorpan@gmail.com
This issue is fixed with below patch
https://chromium-review.googlesource.com/c/chromium/src/+/753102

Comment 11 by f...@opera.com, Dec 21 2017

Labels: -OS-Windows OS-Mac
Status: Fixed (was: Available)
Resolving per c#10.

Comment 12 by f...@opera.com, Dec 21 2017

Mergedinto: 551245
Status: Duplicate (was: Fixed)

Sign in to add a comment