Bug 225962

Summary: Calculated width percent loses the floating point and cause line wrap
Product: WebKit Reporter: Roland Soos <roland>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, koivisto, rado, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: All   
OS: All   
Attachments:
Description Flags
Screenshot
none
Test reduction
none
Test reduction
none
Patch none

Description Roland Soos 2021-05-18 23:46:55 PDT
Steps to reproduce:
1. Open https://jsfiddle.net/jxd3c08u/2/

What went wrong:
Second and third "Hello World" wraps into new line after "Hello"

Expected result:
"Hello World" should be in one line


Cause:
The container element of the Hello World text has floating point width: 183.03px. When we use calculated width (calc(100% - 0px)) it cause probably a rounding and the width for that element becomes 183px and the two word no longer fit into that. 


Firefox and Chrome behaves as expected and there is no line wrap.
Comment 1 Roland Soos 2021-05-19 00:21:45 PDT
Created attachment 429038 [details]
Screenshot
Comment 2 zalan 2021-05-19 06:40:28 PDT
Created attachment 429043 [details]
Test reduction
Comment 3 zalan 2021-05-19 06:48:28 PDT
Created attachment 429045 [details]
Test reduction
Comment 4 zalan 2021-05-19 09:04:59 PDT
Created attachment 429052 [details]
Patch
Comment 5 EWS 2021-05-19 11:18:06 PDT
Committed r277738 (237910@main): <https://commits.webkit.org/237910@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429052 [details].
Comment 6 Radar WebKit Bug Importer 2021-05-19 11:19:14 PDT
<rdar://problem/78214873>
Comment 7 zalan 2021-05-19 11:41:00 PDT
Thanks for the bug report! -appreciate the test reduction.
Comment 8 Simon Fraser (smfr) 2021-06-22 11:03:32 PDT
*** Bug 227025 has been marked as a duplicate of this bug. ***