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 19458 - Specify a CSS feature to do balanced line wrapping as in WebVTT
Summary: Specify a CSS feature to do balanced line wrapping as in WebVTT
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Text (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: fantasai
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on: 17473 17218
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-11 06:45 UTC by Simon Pieters
Modified: 2015-04-08 07:51 UTC (History)
7 users (show)

See Also:


Attachments

Description Simon Pieters 2012-10-11 06:45:42 UTC
+++ This bug was initially created as a clone of Bug #17218 +++

This bug is about relaxing the line balancing algorithm. I'd like balancing to be a CSS feature available for arbitrary content, but then the algorithm in the spec seems too expensive.
Comment 1 Glenn Maynard 2012-10-11 14:49:13 UTC
FYI, my suggestion was to perform ordinary wrapping, then to keep reducing the width and re-wrapping the content until doing so would cause it to increase in height.  This is more expensive than normal wrapping, since it's performing normal wrapping repeatedly, but it's just an increase in the constant factor, not to the algorithmic complexity, and binary searching the width could reduce it to just a few passes.

An example in JS: https://zewt.org/~glenn/balanced-wrapping.html
Comment 2 Ian 'Hixie' Hickson 2012-11-21 19:08:31 UTC
I'm confused. What's the problem with the spec here?
Comment 3 Glenn Maynard 2012-11-21 19:20:01 UTC
http://krijnhoetmer.nl/irc-logs/whatwg/20120418#l-30
Comment 4 Ian 'Hixie' Hickson 2012-11-22 07:11:06 UTC
This isn't CSS, so... what's the problem here?
Comment 5 Simon Pieters 2012-11-22 07:16:56 UTC
That it's not CSS is a problem.

> I'd like balancing
> to be a CSS feature available for arbitrary content
Comment 6 Ian 'Hixie' Hickson 2012-11-22 19:16:11 UTC
If you want CSS to define a balancing feature, that's great, but then this is in quite the wrong component. Even if we did have such a feature, we would still want to define it more strictly for WebVTT than CSS, since that would improve interop, IMHO. So this seems orthogonal.
Comment 7 Glenn Maynard 2012-11-22 19:34:17 UTC
How does it improve interop, when the results are going to depend on the UA's particular font rendering anyway?  This is just another word-wrapping mode, and if it's useful in general and not just for WebVTT, it doesn't make sense for WebVTT and CSS to have *different* balanced wrapping algorithms.
Comment 9 Philip Jägenstedt 2015-04-08 07:51:37 UTC
Thanks, bug 28432 is to use this in WebVTT.