New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 647253 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

HTML5 video subtitles (WebVTT) not showing when video has transform in CSS

Reported by augustoc...@gmail.com, Sep 15 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36

Example URL:
http://iandevlin.github.io/mdn/video-player-with-captions/

Steps to reproduce the problem:
1. Enter URL http://iandevlin.github.io/mdn/video-player-with-captions/
2. Activate subtitles (CC button)
3. Add style { transform: translate(-50%, -50%) } to <video>

Another way of reproducing it is cloning this repository:

1. git clone https://augustomen@bitbucket.org/augustomen/iandevlin.github.io.git
2. Open page /video-player-with-captions/index.html and activate subtitles.

What is the expected behavior?
Subtitles should continue being displayed in the correct position.

What went wrong?
Subtitles are hidden, probably because "translate" transformation didn't apply to them, and they were kept outside the video frame.

Did this work before? No 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.79  Channel: stable
OS Version: Ubuntu 15.10
Flash Version: 

Firefox displays the subtitles correctly, and Safari displays them partially cropped (I guess it may depend on the value).
 
Components: -Internals>Media Internals>Media>Track Blink>CSS
I feel this is by design but need css folks to confirm.
Can repro this. Doesn't seem to be caused by subtitles being outside of the video frame as it still happens when the transform is 1px.
Cc: suzyh@chromium.org
Suzy can you advise if this behavior is intended? 
Labels: Needs-Feedback

Comment 5 by suzyh@chromium.org, Sep 28 2016

Curious, if I turn subtitles on and then add the transform, the subtitles are shown and move with the video. On the other hand, if I add the transform first and then turn subtitles on, the subtitles are hidden, and remain hidden if I remove the transform again. It does look like a bug. I don't think this is an issue with transform or other parts of the animations code, but I'll get a second opinion.
Components: -Blink>CSS
Labels: -Needs-Feedback Hotlist-Interop
Status: Untriaged (was: Unconfirmed)
The behaviour described in #5 sounds like a bug. Order of activation should not affect outcome.

Probably an issue around compositing and subtitles, passing on to the team with a better understanding of the implementation.

Comment 7 by f...@opera.com, Sep 28 2016

Fiddle with simplified TC: https://jsfiddle.net/66xL9jvc/

Comment 8 by f...@opera.com, Sep 30 2016

Owner: f...@opera.com
Status: Assigned (was: Untriaged)
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/753ec4b0cfb34e187a485c9412ddeaca1604da3a

commit 753ec4b0cfb34e187a485c9412ddeaca1604da3a
Author: fs <fs@opera.com>
Date: Fri Sep 30 09:36:03 2016

Don't use absolute bounding boxes in LayoutVTTCue

LayoutVTTCue was using absoluteContentBox()/absoluteBoundingBoxRect()
during overlap resolution. This would mean that boxes were computed
relative to the containing frame. The former also doesn't take
transforms into account, which would mean that the basic overlap check
against the title area would fail if a transform was present.

Instead compute the various bounding boxes relative to a common
ancestor, namely the text track container (which is also the containing
block of the cues.) Adjust the controls rect similarly to get it into the
same coordinate space.

BUG= 647253 

Review-Url: https://codereview.chromium.org/2377193003
Cr-Commit-Position: refs/heads/master@{#422072}

[add] https://crrev.com/753ec4b0cfb34e187a485c9412ddeaca1604da3a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html
[add] https://crrev.com/753ec4b0cfb34e187a485c9412ddeaca1604da3a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html
[modify] https://crrev.com/753ec4b0cfb34e187a485c9412ddeaca1604da3a/third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp
[modify] https://crrev.com/753ec4b0cfb34e187a485c9412ddeaca1604da3a/third_party/WebKit/Source/core/layout/LayoutVTTCue.h

Comment 10 by f...@opera.com, Sep 30 2016

Status: Fixed (was: Assigned)

Sign in to add a comment