Bug 259038

Summary: [CSS Math Functions] Fix failures in css/css-values/minmax-percentage-serialize.html
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Tim Nguyen (:ntim) 2023-07-09 16:27:29 PDT
`min(1%, 2%, 3%)` should stay `min(1%, 2%, 3%)` instead of collapsing to `calc(1%)`, given we can't conclude whether 1% is positive or negative.

Same for `max(1%, 2%, 3%)`.
Comment 1 Radar WebKit Bug Importer 2023-07-09 16:27:38 PDT
<rdar://problem/111986644>
Comment 2 Tim Nguyen (:ntim) 2023-07-09 16:30:26 PDT
The only exception to this is if there's only one argument (see bug 259037)
Comment 3 Tim Nguyen (:ntim) 2023-07-09 18:29:22 PDT
So arguably, WebKit's behavior is more correct here, since it does the collapsing only for properties that have a non-negative range.

The test should perhaps be adjusted to test for both types of properties.
Comment 4 Tim Nguyen (:ntim) 2023-07-09 18:36:41 PDT
It does look like the test uses text-indent, which does take a negative range as well, so WebKit isn't working as intended here.
Comment 5 Tim Nguyen (:ntim) 2023-07-09 19:50:40 PDT
Hmm, this is more about whether a percentage can resolve to a negative value. `text-indent` / `margin-left` percentages are relative to the size of the containing block...