RESOLVED FIXED 144990
Unnecessary line-wrapping for no apparent reason
https://bugs.webkit.org/show_bug.cgi?id=144990
Summary Unnecessary line-wrapping for no apparent reason
Chris Rebert
Reported 2015-05-13 23:24:19 PDT
Created attachment 253100 [details] Screenshot showing incorrect rendering of example on Safari Original Bootstrap bug: https://github.com/twbs/bootstrap/issues/15998 Safari Version: 8.0.6 (10600.6.3) To reproduce: 1. Open http://jsfiddle.net/3mzzwbw7/ in Safari 2. Look at the "Chelesa EBALE" text Expected result: There is ample horizontal room for the text, so it should fit on a single line. Actual result: The text is line-wrapped across 2 lines ("Chelesa" on line 1 and "EBALE" on line 2). Other browsers: Both Chrome and Firefox render the text on a single line, as expected.
Attachments
Screenshot showing incorrect rendering of example on Safari (214.37 KB, image/png)
2015-05-13 23:24 PDT, Chris Rebert
no flags
Copy of JS Fiddle example (461 bytes, text/html)
2015-05-13 23:26 PDT, Chris Rebert
no flags
Reduction (207 bytes, text/html)
2015-05-19 18:06 PDT, Myles C. Maxfield
no flags
Chris Rebert
Comment 1 2015-05-13 23:26:23 PDT
Created attachment 253101 [details] Copy of JS Fiddle example
Myles C. Maxfield
Comment 2 2015-05-19 17:49:06 PDT
Myles C. Maxfield
Comment 3 2015-05-19 17:53:27 PDT
Likely due to a disagreement with the fast and complex text codepaths
Myles C. Maxfield
Comment 4 2015-05-19 18:06:34 PDT
Created attachment 253414 [details] Reduction
Myles C. Maxfield
Comment 5 2015-05-19 18:10:50 PDT
Reduction attached. The element is a float. My intuition says that RenderText::computePreferredLogicalWidths()'s measurement of the width of the text is somehow ending up smaller than BreakingContext::handleText()'s measurement.
Myles C. Maxfield
Comment 6 2015-05-19 18:28:07 PDT
Simple line layout means that TextFragmentIterator is used instead of BreakingContext
Myles C. Maxfield
Comment 7 2015-05-19 18:56:13 PDT
This is due to float precision. :( The disagreement is between RenderText::computePreferredLogicalWidths() and BreakingContext::handleText(). The initial layout uses simple line layout, but when you interact with the page, RenderText::positionForPoint() uses the regular line layout (this subsequent layout is the problematic one). The width of the float is calculated as the sum of the following items: "Chelsea" => 64.998001 " " => 5.00400019 "EBALE" => 55.9980011 Total: 126.000000 Simple line layout agrees with this calculation. However, when we get around to using regular line layout, the width of the text inside the float is calculated as the sum of the following items: "Chelsea" => 64.998001 " EBALE" => 61.0020065 Total: 126.000008 Note that 126.0f + 1 ULP = 126.000008
Simon Fraser (smfr)
Comment 8 2015-07-17 21:31:40 PDT
No longer occurs
Chris Rebert
Comment 9 2015-07-17 23:19:16 PDT
Confirmed that this no longer repros as of r186963. I've removed this from Bootstrap's Wall of Browser bugs: https://github.com/twbs/bootstrap/pull/16842
Note You need to log in before you can comment on or make changes to this bug.