Bug 259690

Summary: [CSS Math Functions] Correct mod() evaluation
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: CSSAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Tim Nguyen (:ntim) 2023-08-01 10:04:21 PDT
According to https://drafts.csswg.org/css-values/#round-func :

Their behavior diverges if the A value and the B step are on opposite sides of zero: mod() (short for “modulus”) continues to choose the integer multiple of B that puts the value between zero and B, as above (guaranteeing that the result will either be zero or share the sign of B, not A), while rem() (short for "remainder") chooses the integer multiple of B that puts the value between zero and -B, avoiding changing the sign of the value.
Comment 1 Radar WebKit Bug Importer 2023-08-01 10:04:33 PDT
<rdar://problem/113213059>
Comment 2 Tim Nguyen (:ntim) 2023-08-01 10:07:07 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16277
Comment 3 EWS 2023-08-01 10:52:23 PDT
Committed 266485@main (440d1baa8043): <https://commits.webkit.org/266485@main>

Reviewed commits have been landed. Closing PR #16277 and removing active labels.