In legacy line layout, whenever a single trailing space/newline character causes the textual content to exceed the available width of a line box, it prematurely stops processing any further inline items, and instead places a line break immediately. This does not occur with consecutive trailing whitespace characters. This leads to several problems: 1) Floats get pushed on to the next line even if they would otherwise fit in the original line. Test case: https://jsfiddle.net/2k9gq45v/2/ 2) If the trailing white space happens at the end of all inline content, the line break position does not reach the end of the RenderObject linked list, causing legacy line layout to not interpret this line box as the last line box. This causes incorrect behavior in text-align-last and text-justify. Test case: https://jsfiddle.net/n6s5p1dr/2/
<rdar://problem/113212304>