2 ms·
While I agree a literal reading of CSS 2.1 implies this, I'm not sure it's a deliberate implicature. I definitely don't think it's meant to imply that greedy li
by gsnedders 8y ago
While I agree a literal reading of CSS 2.1 implies this, I'm not sure it's a deliberate implicature. I definitely don't think it's meant to imply that greedy line breaking must be used (and, IIRC, Prince for example does not).
Filed https://github.com/w3c/csswg-drafts/issues/3756 https://github.com/w3c/csswg-drafts/issues/3756 for this.
- pcwalton 8y agoYou don't think violating that rule would break the Web? I know quite a few Web pages are broken in Servo because it doesn't implement float ceilings inside paragraphs properly.
- gsnedders 8y agoErgh. And I presume they rely on the position relative to the containing block (and therefore also on line-height computation and that whole underdefined mess), rather than the position relative to the line box where the float is placed? Regardless, if it is the case the web relies on this, we should just make it explicitly required to do greedy line breaking. Relying on an implication from here isn't great.
- pcwalton 8y agoI haven't done a comprehensive survey... I just notice it a lot. Mostly it comes up when sites use inline layout as a poor man's flexbox. It might be possible to make better line breaking an opt-in, though.
- gsnedders 8y agoYeah, I could see that would be the case that would likely break if it's violated. Making anything better opt-in sounds all great and well till we end up in this position again whereby we rely on one (or more) browser's unspecified line-breaking algorithm for the "better line-breaking" option. If we specify anything, we probably actually need to specify the algorithm (and given AFAIK there hasn't been notable improvements in decades, that probably isn't the end of the world).
- coldtea 8y ago>Mostly it comes up when sites use inline layout as a poor man's flexbox That's what we get when for 20 years W3C and co ignore layout, and instead have designers (who don't know better) use the styling mechanism of CSS and floats as a layout engine. The only sane layout mechanism for most of those years were tables, which, even though they weren't built for general purpose page layout, they at least had innate layout support for their contents that could be abused. That was abuse, but far less abuse than using floats for layout, the most idiotic "best practice" the web has seen (and promoted with smugness from ignorant designers to boot). At least now we have Flex and Grids. It only took 20 years...