Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: CSS Sign-Related Functions: abs(), sign()

253 views
Skip to first unread message

Chromestatus

unread,
Feb 18, 2025, 8:28:26 AMFeb 18
to blin...@chromium.org, sakh...@chromium.org

Contact emails

sakh...@chromium.org

Explainer

None

Specification

https://www.w3.org/TR/css-values-4/#sign-funcs

Summary

The sign-related functions ​abs() and sign() ​compute various functions related to the sign of their argument. The abs(A) function contains one calculation A, and returns the absolute value of A, as the same type as the input: if A’s numeric value is positive or 0⁺, just A again; otherwise -1 * A. The sign(A) function contains one calculation A, and returns -1 if A’s numeric value is negative, +1 if A’s numeric value is positive, 0⁺ if A’s numeric value is 0⁺, and 0⁻ if A’s numeric value is 0⁻. The return type is a <number>, made consistent with the input calculation’s type.



Blink component

Blink>CSS

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: Shipped/Shipping

WebKit: Shipped/Shipping

Web developers: Strongly positive https://issues.chromium.org/issues/40253181#comment9 https://issues.chromium.org/issues/40253181#comment10

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/css/css-values/signs-abs-computed.html



Flag name on about://flags

CSSSignRelatedFunctions

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/40253181

Estimated milestones

Shipping on desktop 135
Shipping on Android 135
Shipping on WebView 135


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5091423843778560?gate=5117360513744896

This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Feb 18, 2025, 12:28:55 PMFeb 18
to Chromestatus, blin...@chromium.org, sakh...@chromium.org
I see there's 6 tests near the bottom that all browsers are failing. What's up with that?

Flag name on about://flags

CSSSignRelatedFunctions

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/40253181

Estimated milestones

Shipping on desktop 135
Shipping on Android 135
Shipping on WebView 135


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5091423843778560?gate=5117360513744896

This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67b48aed.2b0a0220.393e4c.08de.GAE%40google.com.

Daniil Sakhapov

unread,
Feb 19, 2025, 5:29:12 AMFeb 19
to blink-dev, Mike Taylor, Daniil Sakhapov, Chromestatus
The first 3 tests are for image-resolution property, which we (and others?) don't support.
The last 3 tests are for grid-template-rows, which requires also display: grid, and some elements inside the grid, but the person who added the test didn't change HTML, so the test is wrongly expects a value, but in always will be 'none'.

вторник, 18 февраля 2025 г. в 18:28:55 UTC+1, Mike Taylor:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Yoav Weiss (@Shopify)

unread,
Feb 19, 2025, 7:39:36 AMFeb 19
to blink-dev, Daniil Sakhapov, Mike Taylor, Chromestatus
Thanks for catching us up here!


On Wednesday, February 19, 2025 at 11:29:12 AM UTC+1 Daniil Sakhapov wrote:
The first 3 tests are for image-resolution property, which we (and others?) don't support.

Why not? 

The last 3 tests are for grid-template-rows, which requires also display: grid, and some elements inside the grid, but the person who added the test didn't change HTML, so the test is wrongly expects a value, but in always will be 'none'.

Can we fix the tests?

Daniil Sakhapov

unread,
Feb 19, 2025, 11:54:27 AMFeb 19
to blink-dev, Yoav Weiss, Daniil Sakhapov, Mike Taylor, Chromestatus
I don't know why we don't support image-resolution property, it seems like noone does.

It would make most sense to remove those tests for image-resolution, and move the tests to a separate file for grid-template-rows.

среда, 19 февраля 2025 г. в 13:39:36 UTC+1, Yoav Weiss:

obr...@igalia.com

unread,
Feb 19, 2025, 1:12:52 PMFeb 19
to blink-dev, sakh...@chromium.org, mike...@chromium.org, Chromestatus
The last 3 tests are for grid-template-rows, which requires also display: grid, and some elements inside the grid, but the person who added the test didn't change HTML, so the test is wrongly expects a value, but in always will be 'none'.

You don't need `display: grid` in order to compute `grid-template-rows`. Actually the opposite, with `display: grid` you would get the used value in pixels, so you wouldn't be able to test the actual computed value.
You are just not supporting calculations with `<flex>`:

```
CSS.supports("grid-template-rows: calc(1px)"); // true
CSS.supports("grid-template-rows: calc(1fr)"); // false
```

Daniel Bratell

unread,
Feb 25, 2025, 2:19:53 AMFeb 25
to Daniil Sakhapov, blink-dev, Yoav Weiss, Mike Taylor, Chromestatus

LGTM1

Would be nice if something could be done about the remaining parts, but creating interoperability is valuable on its own.

/Daniel

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/91d654e3-dbb2-4f5b-a13c-f1ee1fa444c5n%40chromium.org.

Mike Taylor

unread,
Feb 25, 2025, 10:39:46 AMFeb 25
to Daniel Bratell, Daniil Sakhapov, blink-dev, Yoav Weiss, Chromestatus

LGTM2

rbyers via Chromestatus

unread,
Feb 26, 2025, 11:17:14 AMFeb 26
to blin...@chromium.org
LGTM3

一丝

unread,
Mar 14, 2025, 6:38:06 AMMar 14
to blink-dev, rbyers via Chromestatus

Daniil Sakhapov

unread,
Mar 14, 2025, 7:59:54 AMMar 14
to blink-dev, 一丝, rbyers via Chromestatus
Hi! I see that it only fails those tests in serialization, not actually computing the value. So it shouldn't affect the usage of the function.
Also, the serialization failing is a separate bug and doesn't include sign() function. 

пятница, 14 марта 2025 г. в 11:38:06 UTC+1, 一丝:
Reply all
Reply to author
Forward
0 new messages