Re: WebVTT wrapping

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/

-- 
Glenn Maynard

Received on Wednesday, 25 April 2012 14:40:48 UTC