Bug 217136

Summary: Floating-point math causes shrink-wrapped content to line wrap sometimes
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: TextAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, eddie.chen, esprehn+autocc, ews-watchlist, glenn, Hironori.Fujii, koivisto, kondapallykalyan, mmaxfield, pdr, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test reduction
none
LFC screenshot
none
Patch none

Description Myles C. Maxfield 2020-09-30 11:43:39 PDT
See https://codepen.io/thiagoboa/pen/abNxRyE?editors=1100

There shouldn't be a line wrap.

(lldb) p m_availableWidth
(float) $18 = 104.5625
(lldb) p m_committedWidth + m_uncommittedWidth
(float) $17 = 104.562508
Comment 1 Myles C. Maxfield 2020-09-30 11:50:45 PDT
Alan: Would LFC fix this?
Comment 2 Radar WebKit Bug Importer 2020-09-30 11:50:59 PDT
<rdar://problem/69801790>
Comment 3 zalan 2020-09-30 12:27:41 PDT
(In reply to Myles C. Maxfield from comment #1)
> Alan: Would LFC fix this?
In LFC the preferred width computation and the actual layout share the same codepath with different constrains, so I'd say yes.
Comment 4 zalan 2020-10-02 21:36:04 PDT
Created attachment 410411 [details]
Test reduction
Comment 5 zalan 2020-10-02 21:38:31 PDT
Created attachment 410412 [details]
LFC screenshot

It is actually fixed in LFC (see screenshot).
Comment 6 zalan 2020-10-03 07:05:17 PDT
Created attachment 410414 [details]
Patch
Comment 7 zalan 2020-10-03 07:11:41 PDT
will try to submit a test case. it needs a custom font with special geometries (to trigger the floating point issue)
Comment 8 Antti Koivisto 2020-10-03 07:17:57 PDT
Comment on attachment 410414 [details]
Patch

No test?
Comment 9 EWS 2020-10-03 08:02:28 PDT
Committed r267923: <https://trac.webkit.org/changeset/267923>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410414 [details].