Re: WebVTT wrapping

On Wed, 25 Apr 2012 16:40:19 +0200, Glenn Maynard <glenn@zewt.org> wrote:

> On Tue, Apr 24, 2012 at 4:43 PM, Ian Hickson <ian@hixie.ch> wrote:
>
>> I've fixed WebVTT to say that lines should be wrapped with line  
>> balancing.
>> So now if you want good line wrapping you can just put it all on one  
>> line,
>> and if you want explicit line breaks you can just put those in too.
>>
>
>> Regardless of the value of the 'white-space' property, any line breaks
> inserted by the user agent for the purposes of line wrapping must be  
> placed
> so as to minimise Δ across each run of consecutive lines between  
> preserved
> newlines in the source. Δ for a set of lines is defined as the sum over
> each line of the absolute of the difference between the line's length and
> the mean line length of the set.
>
> This sounds like the "optimal" approach that was--from what I
> understand--rejected from CSS because it was O(n^2).  The algorithm I
> proposed is is O(n), so it should be possible to change it into a CSS
> white-space style later (which is really where it belongs).
>
> s/absolute/absolute value/

Maybe it can still be turned into a CSS property but using the O(n^2)  
algorithm if the number of lines is less than X and the O(n) algorithm  
otherwise, or maybe make it a QoI issue?

Personally though I think I'd rather have good enough O(n) balancing as a  
CSS property than optimal balancing but only in WebVTT.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 25 April 2012 16:04:35 UTC