Similar to the legacy code LineWidth::FitsOnline we should exclude trailing whitespaces from the line's width calculation while checking whether a float fits on line.
Examples of failed layout tests:
external/wpt/css/CSS2/floats-clear/floats-001.xht
external/wpt/css/CSS2/floats-clear/floats-006.xht
Sorry for the trouble, I started integrating Emil's shaper-driven line breaker. It took longer than expected that the temporary line breaker lived too long. I'll make sure the new line breaker does not have this issue.
Comment 1 by kojii@chromium.org
, May 8 2017