Bug 263145 - round(up) incorrect values
Summary: round(up) incorrect values
Status: RESOLVED DUPLICATE of bug 259702
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:30 PDT by Jane Ori
Modified: 2023-10-14 07:59 PDT (History)
4 users (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:30:17 PDT
round(up, 1px, 1px) computes to 2px, it should be 1px

Here is a reduced test case:
https://codepen.io/propjockey/pen/bGOJOQe/3fa426c2617e00b5481f35583b70c1ff?editors=1100

Firefox has a similar bug but theirs also affects round(down)
https://bugzilla.mozilla.org/show_bug.cgi?id=1859048
Comment 1 Ahmad Saleem 2023-10-14 03:58:48 PDT
I am able to reproduce this bug in WebKit ToT (269337@main) and it is matching 'Firefox Nightly 120', while Chrome Canary 120 is different.

I think first need to check web-spec, whether we need to change our behavior to match Chrome or not.
Comment 2 Tim Nguyen (:ntim) 2023-10-14 07:57:26 PDT
I fixed this in bug 259702, can you please retest in Safari Technology Preview if you have the chance?

> I am able to reproduce this bug in WebKit ToT (269337@main) and it is matching 'Firefox Nightly 120', while Chrome Canary 120 is different.

Ahmad, the expected result is that both bars have the same width. Very strange that you see it match Firefox Nightly, Firefox Nightly has the wrong result on my side.
Comment 3 Tim Nguyen (:ntim) 2023-10-14 07:57:36 PDT

*** This bug has been marked as a duplicate of bug 259702 ***
Comment 4 Ahmad Saleem 2023-10-14 07:58:18 PDT
@Tim, let me attach latest screenshot for reference of what I see.
Comment 5 Ahmad Saleem 2023-10-14 07:59:40 PDT
Ignore me - I think I mixed my window:

Reference 1 px is matching with render round(up, 1px, 1px).