This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15859 - WebVTT: Fixed Anchor Point within cue box and Anchor Point Position within viewport
Summary: WebVTT: Fixed Anchor Point within cue box and Anchor Point Position within vi...
Status: RESOLVED DUPLICATE of bug 20037
Alias: None
Product: TextTracks CG
Classification: Unclassified
Component: WebVTT (show other bugs)
Version: unspecified
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-02 22:10 UTC by vcarbune
Modified: 2012-11-21 19:51 UTC (History)
5 users (show)

See Also:


Attachments

Description vcarbune 2012-02-02 22:10:31 UTC
Here are some thoughts I have about the rendering algorithm from section 3.5 (10.13 - case snap-to-lines is false)

The algorithm seems to combine two different features (anchor point and
anchor point position), under the same numerical values (x%, y%).

It sets the to point (x%, y%) within the cue box at (x%, y%), which is a
very legit approach for cues that don't have changing content (as pop-on
captions), as it ensures that no content of the window will
be outside the viewport.

However, when it comes to cues that adjust their contents or size, things
might get complicated because of the fixed combination, (this means, but
is not limited to: font change, background change, content change - paint-on
or roll-up).

The effect is that (x%, y%) in the interior of the cue box will have different
absolute values within the video viewport, creating a not very pleasant display
effect, by moving the whole displayed cue (instead of keeping it fixed and
append text to it - when text is changed dynamically, for paint-on, specifically).

One solution I can think of is to keep these separate one from the other. The anchor point within the cue box would actually specify the direction in which the cue box expands, as content changes.

Another solution might consist in specifying explicitly how paint-on captions are positioned when only a partial text from the full-text is visible, such that there is no room for interpretation (e.g. if I'm seeing 'ab' from text 'abcd' x%, y% should refer to the final 'abcd')
Comment 1 Ian 'Hixie' Hickson 2012-04-25 21:50:41 UTC
Cues currently can't change the content or size, so this seems moot.
Comment 2 Silvia Pfeiffer 2012-04-30 01:20:33 UTC
Ian: What happens when the user changes the font or the font size in the middle of video playback? That seems to create a content change and is something that a browser has to deal with.
Comment 3 Ian 'Hixie' Hickson 2012-07-24 05:55:00 UTC
Hm, interesting point. I guess if there's an environment change of that nature we should wipe out the list of currently displayed cues (whatever we call it) and start over.
Comment 4 Simon Pieters 2012-09-05 13:46:30 UTC
So it seems there are two issues here:

(1) re-running the rendering rules when cue text or styleing or video viewport etc change (I think there's a separate bug raising this issue as well).

(2) inability to position cues and knowing where e.g. the left edge will end up being if you don't know the cue text or the user's font size or whether it will wrap, and so forth.

Currently the spec uses a "floating" anchor point when positioning a cue using the position and line setting (using %), like background-position in CSS, but this makes it hard to know where the cue will actually appear if you don't know what the size will be. It's not unlikely that people will want to have left-aligned cues that start from a certain point to the left and want that point to be the same for all cues, regardless of their size.

In order to solve that problem, we could introduce a way to specify the anchor point for positioning cues.
Comment 5 Silvia Pfeiffer 2012-09-05 14:53:32 UTC
(In reply to comment #4) 
> In order to solve that problem, we could introduce a way to specify the anchor
> point for positioning cues.

I would like to propose to extend this to specifying a rendering area into which one or several cues may be rendered. The rendering area would be defined by a percentage width (just like "size" currently works) and a number of lines height, and it would be anchored. This would help us solve several requirements:
* we can exactly position the rendering area and the cues rendered therein
* we can define a background color on the rendering area
* with the defined height of the rendering area we can introduce a rollup feature such that adding cues to the rendering area will push previously added cues up or down within the n lines rendering area

All three of these features, plus the concept of rendering areas are requirements in the FCC caption act (there, the rendering area is called a "window").

If we design this carefully, it can be an advanced feature that can fall back to current cue rendering rules for UAs that don't support the "window" concept.
Comment 6 Silvia Pfeiffer 2012-09-05 15:10:22 UTC
BTW: the FCC order is at http://www.fcc.gov/document/closed-captioning-internet-protocol-delivered-video-programming-0
Comment 7 Simon Pieters 2012-09-06 06:53:38 UTC
Silvia, rollup is off-topic for this bug.
Comment 8 Simon Pieters 2012-09-06 06:54:47 UTC
(In reply to comment #1)
> Cues currently can't change the content or size, so this seems moot.

They can with the DOM API and style sheets.
Comment 9 Silvia Pfeiffer 2012-09-06 11:46:58 UTC
(In reply to comment #7)
> Silvia, rollup is off-topic for this bug.

Agreed. My proposal was just trying to generalize the proposed solution and thus allow for a simple resolution of other issues as well. However, we can take it step by step if that's preferable.
Comment 10 Ian 'Hixie' Hickson 2012-11-21 19:25:05 UTC
(In reply to comment #8)
> (In reply to comment #1)
> > Cues currently can't change the content or size, so this seems moot.
> 
> They can with the DOM API and style sheets.

They can't change content or size even that way, since once a cue is being rendered, its boxes aren't recomputed. Only things like 'color' take effect.

I couldn't find a bug asking for cues to be reset if the style sheet changes. If you would like that to happen (which is needed if you want style sheet changes to take effect when they resize the active cues), please file a bug. Note that doing this while the video is playing would be annoying for users, so maybe we should limit this to only when the video is paused.


Regarding how %s work for positioning, I think we should just redesign the positioning mechanism.
Comment 11 Ian 'Hixie' Hickson 2012-11-21 19:51:48 UTC

*** This bug has been marked as a duplicate of bug 20037 ***