Bug 195401

Summary: Transform scale() combined with a devicePixelRatio creates roundoff errors
Product: WebKit Reporter: Tom Dezentje <tomdezentje>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: All   
OS: All   

Description Tom Dezentje 2019-03-06 23:35:56 PST
When a browser has a devicePixelRatio with decimals there seems to be a roundoff error.
As shown in the following example: https://jsfiddle.net/xb813adh

The red bar is always 100px and scales accordingly.
The blue bar is 1px width scaled with a transform. It should always be the same width as the red bar.

When zooming in the width of the blue bar stays the same for 1, 1.10 and 1.25. 
After that it stays the same until a scale of 2.

Changing the example to scale 50px 2 times gives minor roundoff errors but is still incorrect.
Seen here: https://jsfiddle.net/y9jg10hp/

Other browsers show the correct working.
Comment 1 Radar WebKit Bug Importer 2019-03-06 23:36:48 PST
<rdar://problem/48667104>