Bug 225962 - Calculated width percent loses the floating point and cause line wrap
Summary: Calculated width percent loses the floating point and cause line wrap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 14
Hardware: All All
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
: 227025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-18 23:46 PDT by Roland Soos
Modified: 2021-06-22 11:03 PDT (History)
6 users (show)

See Also:


Attachments
Screenshot (17.37 KB, image/png)
2021-05-19 00:21 PDT, Roland Soos
no flags Details
Test reduction (186 bytes, text/html)
2021-05-19 06:40 PDT, zalan
no flags Details
Test reduction (258 bytes, text/html)
2021-05-19 06:48 PDT, zalan
no flags Details
Patch (3.75 KB, patch)
2021-05-19 09:04 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 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. ***