Open gsnedders opened 5 years ago
Servo doesn't implement this rule properly and the result is a lot of broken pages. Web compat is something we need to carefully consider if we relax this constraint.
If it is the case the web relies on this, we should just make it explicitly required to do greedy line breaking (probably in CSS Text, rather than CSS 2.1). Relying on an implication from here isn't great. (Adding the css-text-3
label on that basis.)
It might only be a subset of cases that the Web relies on though. I don't mean to kill the attempts at better line breaking without a proper investigation.
@pcwalton can you find any of the Servo issues about this? or pages that are broken in Servo? Would be a decent starting point to start looking!
Here are some examples: https://github.com/servo/servo/issues/12092 https://github.com/servo/servo/issues/14807
Main issue: https://github.com/servo/servo/issues/13683
Note that these particular pages won't be broken with Knuth line breaking, but to me it indicates that web compat investigation is needed. I wouldn't be surprised if there are pages that do depend on float ceiling and greedy line breaking interaction.
I think the set of pages that depend on greedy/float interactions would already be broken in some circumstances. If you are depending on line breaking for a particular float ceiling placement, then a change in font or user font size preference could mess with your intentions. We have never had complete interoperability in line breaks, even with everyone using nearly identical greedy algorithms.
I think it would be reasonable to interpret the 'as possible' float positioning rules as penalties in line breaking scores. A set of line breaks that placed a float higher would score better than a set that placed a left float lower but more left.
From https://news.ycombinator.com/item?id=19473277:
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.