Bug 254990

Summary: transform loses accuracy on page zoom
Product: WebKit Reporter: Carlos Lopez <clshortfuse>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, karlcow, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Screenshot none

Carlos Lopez
Reported 2023-04-04 06:36:15 PDT
When using page zoom, a transform will lose accuracy at times. Note the following codepen: https://codepen.io/shortfuse/pen/qBJWbbd When zooming in and out on the page, the black dot will move around, not staying in sync with the red circle. The lines causing the problem are (with --value fixed as 1): ```css #thumb-anchor { inline-size: 1%; transform: translateX(calc(var(--value) * 100 * 100%)); } ``` Removing CSS Variables shows the issue is not related to CSS Vars: ```css #thumb-anchor { inline-size: 1%; transform: translateX(10000%); } ``` It's personally low priority for me since I found a fix, but it's still a strange bug: ```css #thumb-anchor { inline-size: 100%; transform: translateX(calc(var(--value) * 100%)); } ```
Attachments
Screenshot (21.83 KB, image/png)
2023-04-05 15:51 PDT, Simon Fraser (smfr)
no flags
Ahmad Saleem
Comment 1 2023-04-04 15:18:50 PDT
I am able to reproduce this on WebKit ToT (262590@main) as well, I zoomed out and 'black' dot moved while it didn't in Chrome Canary 114.
Simon Fraser (smfr)
Comment 2 2023-04-05 15:51:35 PDT
Created attachment 465786 [details] Screenshot
Radar WebKit Bug Importer
Comment 3 2023-04-05 15:51:57 PDT
Note You need to log in before you can comment on or make changes to this bug.