Re: background box tweaking (was Re: Alternative approach to scrolling, with demos)

On Mon, May 5, 2014 at 7:58 PM, Philip Jägenstedt <philipj@opera.com> wrote:
> On Tue, Apr 8, 2014 at 9:06 AM, Silvia Pfeiffer
> <silviapfeiffer1@gmail.com> wrote:
>> On Sun, Mar 30, 2014 at 4:41 PM, Philip Jägenstedt <philipj@opera.com> wrote:
>>>
>>> == Background box tweaking ==
>>>
>>> Demo: http://people.opera.com/philipj/2014/03/vttscroll/background.html
>>>
>>> WebVTT doesn't do a good job with the cue background right now. The
>>> only thing you can put a background on is the line box. One small
>>> improvement to this would be to allow a background on the cue box
>>> instead. This demo does exactly that, and visually it looks the same
>>> as a single region background.
>>
>> There is a difference between the background on the cue and the
>> background on the region. CEA708 distinguishes between the two.
>
> The only thing you can style in WebVTT now is the "WebVTT cue
> background box", which I called the "line box" above because it's an
> inline element that behaves like a <span> wrapping the text.
>
> My tweak was to style the cue box itself, a box for which there is no
> pseudo-element currently but there could be.
>
> In other words, there would still be two things to set a background on.

Right. We need three concepts for putting backgrounds on: we need the
line box, the cue box, and the group of cues - the latter of which is
for CEA708.


>> I've already changed the WebVTT spec a while ago to allow putting a
>> color on the background box, see: "the properties corresponding to the
>> 'background' shorthand must be applied to the WebVTT cue background
>> box rather than the List of WebVTT Node Objects."
>
> Which change was that? It seems like this bit goes back to when Hixie
> was the editor.

Actually, you're right - it has already been around from when Ian was
editor. I just added more styling to it like padding, overflow and
box-sizing.


>> That works well for individual cues. It works badly for groups of cues
>> that are in a region. Try zooming the page in and out with your demo.
>> At some points you will see a line going through the otherwise solid
>> box. That's because we're faking a solid square through its individual
>> line components. That's bound to come back and hurt us, in particular
>> if somebody decides to make the individual lines not the same width.
>>
>> I'm not a fan of faking it in this way.
>
> OK, this is a problem. The same problem will happen when trying to map
> the fixed-grid 608 to WebVTT, because you'll get numerical errors when
> trying to get exactly 15 rows of text and the backgrounds of the
> individual lines won't line up as they should. Any ideas for how to
> fix that?

I don't follow: how is that the same problem?

In any case, the 608 spec at
https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html
has a line height of 5.33% to make 15 rows on 80% of the screen
height. That gives an error or 0.05% which is likely acceptable. Since
we've moved to floats for percentages, we've done much better than
before when it was all int.

Silvia.

Received on Monday, 5 May 2014 11:34:47 UTC