Bug 259702 - [CSS Math Functions] round() is incorrect when number is a multiple of step
Summary: [CSS Math Functions] round() is incorrect when number is a multiple of step
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Tim Nguyen (:ntim)
Keywords: InRadar
: 263145 (view as bug list)
Depends on:
Reported: 2023-08-01 13:21 PDT by Natalie Weizenbaum
Modified: 2023-10-14 07:57 PDT (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Weizenbaum 2023-08-01 13:21:30 PDT
According to CSS Values and Units 4 (https://drafts.csswg.org/css-values-4/#round-func), for any round() strategy,

> If A is exactly equal to an integer multiple of B, round() resolves to A exactly

However, round(up, 10px, 5px) resolves to 15px instead of 10px as it should.

Tested in Safari 16.6.
Comment 1 Radar WebKit Bug Importer 2023-08-01 16:10:04 PDT
Comment 2 Tim Nguyen (:ntim) 2023-08-01 18:49:24 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16302
Comment 3 Tim Nguyen (:ntim) 2023-08-01 18:57:22 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/41284
Comment 4 EWS 2023-08-01 21:05:05 PDT
Committed 266504@main (58d1ff825f4e): <https://commits.webkit.org/266504@main>

Reviewed commits have been landed. Closing PR #16302 and removing active labels.
Comment 5 Tim Nguyen (:ntim) 2023-10-14 07:57:36 PDT
*** Bug 263145 has been marked as a duplicate of this bug. ***