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 19744 - WebVTT: Remove restriction to apply edge padding only to cues with snap-to-lines flag set
Summary: WebVTT: Remove restriction to apply edge padding only to cues with snap-to-li...
Status: RESOLVED WONTFIX
Alias: None
Product: TextTracks CG
Classification: Unclassified
Component: WebVTT (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
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-10-28 15:21 UTC by Silvia Pfeiffer
Modified: 2012-11-22 07:37 UTC (History)
5 users (show)

See Also:


Attachments

Description Silvia Pfeiffer 2012-10-28 15:21:53 UTC
Section 3.5 (WebVTT cue text rendering rules), step 10 (run following substeps for each cue), substep 10 should not be restricted to cues with the snap-to-lines flag set, since it provides edge margin padding, which should be available to all cues.
Comment 1 Ian 'Hixie' Hickson 2012-10-29 23:03:16 UTC
If we made it apply to non-line-aligned cues, then you wouldn't know where stuff was going to be positioned, so you couldn't position cues precisely, which is the whole points of being able to position cues.
Comment 2 Silvia Pfeiffer 2012-10-29 23:39:53 UTC
Is this because you expect edgemargin to be of different size between different players?

Edgemargin was introduced to avoid painting outside the visible area. So, if we position a cue explicitly and it lands outside the visible area, are you saying that's ok for explicitly positioned cues?

In my mind edgemargin reduces the viewport size to the visible area and anything that is explicitly positioned just gets squished a little, but still essentially sits in the right relative place, which is the important part. Cutting text off because it's outside the visible area is a worse solution in my opinion.
Comment 3 Glenn Maynard 2012-10-30 00:51:42 UTC
The spec says it's UA-defined.  That's what I'd expect, since most computer monitors and well-configured HDTVs have no overscan.  (Plus, nothing has overscan if you're in a window far from the edge of the screen.)  A smart implementation could disable overscan in these cases to avoid unnaturally large empty spaces on the edge of the screen/window.

(This also avoids baking overscan into WebVTT forever.  Overscan is much less of a problem than it used to be, and if it goes away completely in hardware some day, implementations should be able to define it as 0 and get rid of it.)

If you're precisely aligning cues to things on screen, you don't want your positions getting nudged around weirdly to fit within overscan.  If you're just saying "put this text near the top/bottom of the screen" then you do, but I guess the idea is that you wouldn't use percentages for that (though no doubt some people will anyway; if they do that may subvert this feature).
Comment 4 Silvia Pfeiffer 2012-10-30 09:52:16 UTC
If that's the intention, then I don't understand why we make the application of edgemargin dependent on snap-to-lines set, which could also mean that somebody has explicitly set a "position" in the cue settings and that position could be positioning the cue in the left or right edge of the viewport, since exact positioning doesn't just happen in the "line" dimension.

I'm not sure how to deal with that, though. Maybe there needs to be an overlap avoidance with the edgemargin region in this case.
Comment 5 Glenn Maynard 2012-10-30 14:27:52 UTC
(In reply to comment #4)
> If that's the intention, then I don't understand why we make the application
> of edgemargin dependent on snap-to-lines set, which could also mean that
> somebody has explicitly set a "position" in the cue settings and that
> position could be positioning the cue in the left or right edge of the
> viewport, since exact positioning doesn't just happen in the "line"
> dimension.
> 
> I'm not sure how to deal with that, though. Maybe there needs to be an
> overlap avoidance with the edgemargin region in this case.

Only "line" sets snap-to-lines, not "position", right?

From what I can see, both "edge margin" and "snap-to-lines" are only relevant to positioning on the X axis[1].  They're only used when in "line-based" positioning, not in percent-based positioning, and the Y axis doesn't support line-based positioning in the first place.

(If it did--say, for CJK--then I expect it would have a separate flag, like "snap-to-columns", that respectively only affects the Y axis.)


[1] speaking in terms of horizontal text, of course
Comment 6 Silvia Pfeiffer 2012-10-30 23:02:30 UTC
I was starting to write a reply, but then I realized that we can't do line-based positioning via "position" with anything but percentage. As you think with percentage positioning we should not apply an edge-margin, I concede, the spec is correct to your requirements.

(Note that I still maintain a different opinion: if there is an area of the screen where we are not able to read anything because of overscan, I maintain my opinion that we should not ever paint captions in there and rather move them out of there, no matter whether captions were explicitly positioned or not.)
Comment 7 Silvia Pfeiffer 2012-11-01 00:13:31 UTC
No, I actually can't leave this alone. :-)

As currently specified, the edge margin is only applied to the left and right edges of the video (for horizontal cues). So, when we have overscan and are positioning in line -1, the left and right edges of the cue get the margin, but the cue still sits at the bottom boundary of the video viewport. (This is independent of whether the cue has a position value or not.)

Even given your condition that the edge margin is only applied to non-explicitly positioned cues - we still need to also apply it in y-position direction, not just in x-position dimension.

That all makes me wonder whether it wouldn't be easier to drop the whole idea of edge margin and instead tell players that need to avoid overscan to make use of the technique in bug 17273.
Comment 8 Silvia Pfeiffer 2012-11-01 00:20:51 UTC
Gah, I implemented this and I double-checked it and I still didn't see it. There is a second section that does the y-position adjustment. So, forget that part of the last comment. (Sorry for the noise).

But the last idea may be a valid one still: to use viewport.occupy to achieve the same effect?
Comment 9 Philip Jägenstedt 2012-11-01 08:37:38 UTC
Yeah, we could potentially do that, it seems like it could make the implementation simpler.
Comment 10 Ian 'Hixie' Hickson 2012-11-01 22:28:11 UTC
I do not know what viewport.occupy means.

I don't understand the problem here.
Comment 11 Silvia Pfeiffer 2012-11-02 02:45:37 UTC
Bug 17273. Sorry, the function is not called "occupy", but "add".
Comment 12 Ian 'Hixie' Hickson 2012-11-02 21:13:37 UTC
Having the UA add the area to the bug 17273 mechanism wouldn't work because it would not shift the lines up to abut the overscan area, instead it would shift the lines by an entire line-height.
Comment 13 Silvia Pfeiffer 2012-11-02 22:37:18 UTC
FYI: the CEA-708 spec and its handling of overscan may be of interest
http://www.scribd.com/doc/70239447/CEA-708-B
in particular the image on pg 26

You'll see that it defines a "safe-image area" and the coordinates of the caption format are defined only on that area, including for explicitly positioned caption "windows" (as they call the rendering areas for cues).

Apparently they are not worried about position changes for explicitly positioned cues when the safe-image area differs between players and it's more important to make sure the captions end up in the "safe" area.
Comment 14 Ian 'Hixie' Hickson 2012-11-21 19:38:13 UTC
Yeah, but that standard dates from the 90s and drags into it stuff from decades prior. Overscan is a problem that will progressively go away, so we should plan ahead for when it's gone. If you position the cue precisely, why would be promptly go and ignore your settings?
Comment 15 Silvia Pfeiffer 2012-11-22 00:46:44 UTC
CEA-708 was developed for Digital TV, originated in 1999, updated in 2002 and is only now being implemented in set-top boxes. I don't call that outdated.
Comment 16 Ian 'Hixie' Hickson 2012-11-22 06:37:49 UTC
The TV industry is a rather slower industry than the Web.
Comment 17 Silvia Pfeiffer 2012-11-22 07:37:54 UTC
Considering that CEA-708 has more features than WebVTT and is born out of many years of experience with captions, we should look to learn from it, not ignore it.

Anyways - I am no longer fussed about this bug. It's always possible for players to define a smaller video viewport on which captions can be rendered if they have areas on the screen that need to be avoided. So I'm closing this bug as wontfix.