To reproduce this bug, open the attached test case, choose Use ATSU For All Text from Safari's Debug menu and reload the page. Notice that the layout changes (the line breaks after Lorem) and if you are using a debug build, an error will be printed: ERROR: unexpected result from ATSUGetGlyphBounds(): actualNumBounds(389998136) != 1
Created attachment 9299 [details] Test case
Created attachment 9300 [details] Patch with manual test and changelog
Comment on attachment 9300 [details] Patch with manual test and changelog Will this extra check have a measurable performance impact? If not, then r=me, but how can we be sure?
Comment on attachment 9300 [details] Patch with manual test and changelog Going to play it safe performance-wise and move the check into the complex path where it matters.
Created attachment 9341 [details] Patch Move the empty run check down into floatWidthForComplexText()
Comment on attachment 9341 [details] Patch r=me Even better if there was a comment explaining that this is not just an optimization, but required for correct results, but the layout test should suffice.
Committed revision 15305.