Bug 217136 - Floating-point math causes shrink-wrapped content to line wrap sometimes
Summary: Floating-point math causes shrink-wrapped content to line wrap sometimes
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
Keywords: InRadar
Depends on:
Reported: 2020-09-30 11:43 PDT by Myles C. Maxfield
Modified: 2021-01-05 12:59 PST (History)
11 users (show)

See Also:

Test reduction (247 bytes, text/html)
2020-10-02 21:36 PDT, zalan
no flags Details
LFC screenshot (47.55 KB, image/png)
2020-10-02 21:38 PDT, zalan
no flags Details
Patch (3.07 KB, patch)
2020-10-03 07:05 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
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]
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]

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].