Bug 263141 - @property integer syntax rounds numbers incorrectly
Summary: @property integer syntax rounds numbers incorrectly
Status: RESOLVED DUPLICATE of bug 260777
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-13 15:22 PDT by Jane Ori
Modified: 2023-10-14 08:00 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jane Ori 2023-10-13 15:22:14 PDT
Safari is using an away-from-zero rounding strategy to cast number values assigned to an integer property.

Chrome uses the "nearest" strategy that JS's Math.round() uses.
"nearest" is also the default rounding for the round() CSS function

Here is a reduced test case showing the differences:

https://codepen.io/propjockey/pen/vYvMbaX/253c4756c72e962cb10b0c19b396ea37?editors=1100

Thank you!
// Jane
Comment 1 Tim Nguyen (:ntim) 2023-10-14 08:00:46 PDT
I switched to using a towards positive infinity rounding strategy in bug 260777. Can you please re-test in STP?

*** This bug has been marked as a duplicate of bug 260777 ***