[csswg-drafts] [css2] line boxes shouldn't be pushed down around floats when there isn't a breaking opportunity at the start of the line

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

== [css2] line boxes shouldn't be pushed down around floats when there isn't a breaking opportunity at the start of the line ==
CSS2 [says](https://drafts.csswg.org/css2/visuren.html#floats):

> If a shortened line box is too small to contain any content, then the line box is shifted downward (and its width recomputed) until either some content fits or there are no more floats present.

While it's not entirely clear what "contain any content" means, I think this generally means that no content can be fit within the line box because the first unbreakable piece of content overflows the width of the line box.  The wording in the spec essentially means that you then push down to the first possible position for that line (rather than creating a bunch of empty lines and then having a gap below the float due to the line rhythm), so it's modeled on the basis that the pushing down comes from a breaking opportunity at the start of the line box.

However, given that browsers interoperably (see [test](https://dbaron.org/css/test/2018/float-nowrap)) do not push down lineboxes in `white-space: pre` or `white-space: nowrap` boxes, I think this behavior should not apply when `white-space` is `nowrap` or `pre` (or, in [css-text-4 terminology](https://drafts.csswg.org/css-text-4/#white-space-property), when `text-wrap` is `nowrap`) for the breaking opportunity at the start of the line box.  (This probably needs to be defined a little bit more formally.)

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

Received on Wednesday, 22 August 2018 01:15:18 UTC