Bug 254990 - transform loses accuracy on page zoom
Summary: transform loses accuracy on page zoom
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-04-04 06:36 PDT by Carlos Lopez
Modified: 2023-04-06 00:37 PDT (History)
5 users (show)

See Also:


Attachments
Screenshot (21.83 KB, image/png)
2023-04-05 15:51 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Lopez 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%));
}
```
Comment 1 Ahmad Saleem 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.
Comment 2 Simon Fraser (smfr) 2023-04-05 15:51:35 PDT
Created attachment 465786 [details]
Screenshot
Comment 3 Radar WebKit Bug Importer 2023-04-05 15:51:57 PDT
<rdar://problem/107682651>