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

On Mon, May 5, 2014 at 10:14 PM, Philip Jägenstedt <philipj@opera.com> wrote:
> On Mon, May 5, 2014 at 1:33 PM, Silvia Pfeiffer
> <silviapfeiffer1@gmail.com> wrote:
>> 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.
>
> There's currently no way to style the cue box. Are there clear use
> cases for styling the cue box, other than faking a region as in my
> case?

Yes, the famous background box on CEA708 "windows". Discussions on
this are happening on other threads now.

>>>> 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.
>
> In my demo the boxes are exactly aligned and you still get gaps when
> zooming. In other words, you'll have the same problem even if you
> manage to get 15 exactly aligned lines.

Right. This is why a cue region makes a difference. It provides a
background for all cues together.

Anyway - I think the use case for the background box and the different
level colorings are being re-examined in other threads. Let's wait for
feedback on that.

Cheers,
Silvia.

Received on Monday, 12 May 2014 03:08:07 UTC