Steps to repro: Open the following data:text/html;charset=utf8,<style>li { display: inline; word-spacing: -0.125em; } li:after { content: " • "; } li:last-child:after { content: none; } li span { white-space: normal; } ul { white-space: nowrap }</style><table><tr><td><ul><li>a</li><li><span>b </span></li><li><span>c</span></li></ul></td></tr></table> Expected: Have all of them in one line, like Firefox and Chrome Actual: There is an extra wrap and this has turned into two lines This is reduction of a Wikipedia page https://fa.wikipedia.org/wiki/الگو:الکترومغناطیس and actually I'm seeing this there very frequently.
Simpler testcast: data:text/html;charset=utf8,<table><td><span style="white-space: nowrap"><span style="word-spacing: -0.125em;">a • </span><span style="word-spacing: -0.125em;"><span style="white-space: normal;">b </span> • </span><span style="word-spacing: -0.125em;">c</span></span></td></table>
Simpler testcase: data:text/html,<table><td><span style="word-spacing: -0.125em; white-space: nowrap"><span style="white-space: normal;">a </span> - </span>b</td></table>
Happens with WebKit ToT, cfab25f0bf96f64c1e6ad30979788cabaa4a4f4f
(in addition to the stable Safari)
<rdar://problem/132633448>
:( alright, let's get this fixed. Thank you for reporting it!
Created attachment 471983 [details] Test reduction This bug is not specific to tables. Any shrink-to-fit content fails.
Line wrap is caused by not accounting for negative word-space when probing if content fits the line.
Created attachment 471984 [details] Screenshot after fix is applied this looks to be fixed. will post patch soon.
Created attachment 471992 [details] Patch
Created attachment 471994 [details] Patch
Created attachment 471996 [details] Patch
Created attachment 472007 [details] Patch
I just built WebKit with patch 472007 here locally and can confirm it now works locally including on the original page I spotted the issue. Thank you for the fix! 😊
Created attachment 472017 [details] [fast-cq]Patch
(In reply to Ebrahim Byagowi from comment #14) > I just built WebKit with patch 472007 here locally and can confirm it now > works locally including on the original page I spotted the issue. Thank you > for the fix! 😊 Excellent! Thank you for verifying it!
Committed 281600@main (0bf7c728f0c7): <https://commits.webkit.org/281600@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 472017 [details].