[csswg-drafts] Float positioning "as high as possible" prohibits non-greedy line-breaking (#3756)

gsnedders has just created a new issue for https://github.com/w3c/csswg-drafts:

== Float positioning "as high as possible" prohibits non-greedy line-breaking ==
From https://news.ycombinator.com/item?id=19473277:

>  [Doing better line breaking in web browsers] comes up on every thread related to web typography, and the answer as always is that it's not possible in the general case, at least not with the specs as they are today. The biggest problem is that the CSS specification demands that a float be placed as high as possible (CSS 2.1 section 9.5.1, rule 8 [1]). But float ceilings can be anywhere in the middle of a paragraph. By its nature, Knuth line breaking means that any particular unit (word), and therefore any float ceiling, might not be as high as possible. In fact, the only algorithm that can be used in this case to satisfy the spec is the greedy one. Therefore, Knuth line breaking cannot be used on the Web.
>
> It might be possible to use Knuth line breaking in specific circumstances, such as when paragraphs have no floats. But not in general.
>
> [1]: https://www.w3.org/TR/CSS2/visuren.html#float-position 

If I'm not mistaken, Prince doesn't do this, and I'm dubious that this is the intention of the "as high as possible" rule. Quite how we should phrase the rule if we want to loosen this is a… harder question.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3756 using your GitHub account

Received on Sunday, 24 March 2019 00:54:10 UTC