Bug 259038 - [CSS Math Functions] Fix failures in css/css-values/minmax-percentage-serialize.html
Summary: [CSS Math Functions] Fix failures in css/css-values/minmax-percentage-seriali...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-09 16:27 PDT by Tim Nguyen (:ntim)
Modified: 2023-07-09 19:50 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 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...