Intent to Ship: CSS <image> Syntax for registered Custom Properties

82 views
Skip to first unread message

Rune Lillesveen

unread,
Oct 4, 2023, 5:09:21 AM10/4/23
to blink-dev

Contact emails

fut...@chromium.organd...@chromium.org

Explainer

None

Specification

https://drafts.css-houdini.org/css-properties-values-api-1/#syntax-strings

Summary

Supports using the <image> syntax for custom properties registered with @property or registerProperty(). The <image> syntax can be used to restrict values of the custom property to url() values and generated images like gradients.


This syntax was initially excluded from the valid syntaxes mainly because images were not interpolable and that it would add to the usefulness of the syntax to be able to interpolate directly on the custom property. The other engines have shipped the image syntax without supporting interpolation. There are two interpolation methods in css-image-4, cross-fade() and per stop interpolation for gradients. The gradient interpolation is not shipped by any browser (even for standard properties). Safari ships a non-standard compliant cross-fade() interpolation for standard properties (at least for background-image), but not for the registered custom properties.


We have an OKR to look into cross-fade() for Q4. If we end up shipping that, it will work for both registered custom properties and standard properties.


The <image> syntax for registered custom properties is part of Interop 2023.



Blink component

Blink>CSS

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: Shipped/Shipping Does not support interpolation

WebKit: Shipped/Shipping Does not support interpolation

Web developers: No signals

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

No additional devtools support necessary compared to existing syntaxes.



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

Yes

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

Yes

https://wpt.fyi/css/css-properties-values-api/at-property.html https://wpt.fyi/css/css-properties-values-api/register-property-syntax-parsing.html https://wpt.fyi/css/css-properties-values-api/typedom.html



Flag name on chrome://flags

#enable-experimental-web-platform-features

Finch feature name

CSSVariables2ImageValues

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop120
DevTrial on desktop115
Shipping on Android120
DevTrial on Android115


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/5142205606133760

This intent message was generated by Chrome Platform Status.

--
Rune Lillesveen

Rune Lillesveen

unread,
Oct 4, 2023, 6:23:51 AM10/4/23
to blink-dev
On Wed, Oct 4, 2023 at 11:08 AM Rune Lillesveen <fut...@chromium.org> wrote:

Contact emails

fut...@chromium.organd...@chromium.org

Explainer

None

Specification

https://drafts.css-houdini.org/css-properties-values-api-1/#syntax-strings

Summary

Supports using the <image> syntax for custom properties registered with @property or registerProperty(). The <image> syntax can be used to restrict values of the custom property to url() values and generated images like gradients.


This syntax was initially excluded from the valid syntaxes mainly because images were not interpolable and that it would add to the usefulness of the syntax to be able to interpolate directly on the custom property. The other engines have shipped the image syntax without supporting interpolation. There are two interpolation methods in css-image-4, cross-fade() and per stop interpolation for gradients. The gradient interpolation is not shipped by any browser (even for standard properties). Safari ships a non-standard compliant cross-fade() interpolation for standard properties (at least for background-image), but not for the registered custom properties.


We have an OKR to look into cross-fade() for Q4. If we end up shipping that, it will work for both registered custom properties and standard properties.


The <image> syntax for registered custom properties is part of Interop 2023.



Blink component

Blink>CSS

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: Shipped/Shipping Does not support interpolation

Sorry, this is not correct. It's implemented behind a flag, not shipping yet.


--
Rune Lillesveen

Daniel Bratell

unread,
Oct 11, 2023, 7:06:23 AM10/11/23
to Rune Lillesveen, blink-dev

LGTM1

(Privacy and Security steps in Chromestatus are not completed but they are unlikely to affect anything)

/Daniel

--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeRpL_rGG0%2BuaCiozmx6PoShU4H4SY8HaZwCKs8aReKnUg%40mail.gmail.com.

Emilio Cobos Álvarez

unread,
Oct 11, 2023, 9:51:05 AM10/11/23
to Rune Lillesveen, blink-dev
FWIW we don't ship this (outside of the nightly channel), so not sure
where the gecko status is coming from, but it's not accurate.

(Not that I object to this change tho)

-- Emilio

On 10/4/23 11:08, Rune Lillesveen wrote:
>
> Contact emails
>
> fut...@chromium.org <mailto:fut...@chromium.org>, and...@chromium.org
> <mailto:and...@chromium.org>
>
>
> Explainer
>
> None
>
>
> Specification
>
> https://drafts.css-houdini.org/css-properties-values-api-1/#syntax-
> strings <https://drafts.css-houdini.org/css-properties-values-api-1/
> #syntax-strings>
>
>
> Summary
>
> Supports using the <image> syntax for custom properties registered with
> @property or registerProperty(). The <image> syntax can be used to
> restrict values of the custom property to url() values and generated
> images like gradients.
>
>
> This syntax was initially excluded from the valid syntaxes mainly
> because images were not interpolable and that it would add to the
> usefulness of the syntax to be able to interpolate directly on the
> custom property. The other engines have shipped the image syntax without
> supporting interpolation. There are two interpolation methods in css-
> image-4, cross-fade() and per stop interpolation for gradients. The
> gradient interpolation is not shipped by any browser (even for standard
> properties). Safari ships a non-standard compliant cross-fade()
> interpolation for standard properties (at least for background-image),
> but not for the registered custom properties.
>
>
> We have an OKR to look into cross-fade() for Q4. If we end up shipping
> that, it will work for both registered custom properties and standard
> properties.
>
>
> The <image> syntax for registered custom properties is part of Interop 2023.
>
>
>
> Blink component
>
> Blink>CSS <https://bugs.chromium.org/p/chromium/issues/list?
> q=component:Blink%3ECSS>
>
>
> TAG review
>
> None
>
>
> TAG review status
>
> Not applicable
>
>
> Risks
>
>
>
> Interoperability and Compatibility
>
> None
>
>
>
> /Gecko/: Shipped/Shipping Does not support interpolation
>
> /WebKit/: Shipped/Shipping Does not support interpolation
>
> /Web developers/: No signals
>
> /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
>
> No additional devtools support necessary compared to existing syntaxes.
>
>
>
> Will this feature be supported on all six Blink platforms
> (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
>
> Yes
>
>
> Is this feature fully tested by web-platform-tests <https://
> chromium.googlesource.com/chromium/src/+/main/docs/testing/
> web_platform_tests.md>?
>
> Yes
>
> https://wpt.fyi/css/css-properties-values-api/at-property.html <https://
> wpt.fyi/css/css-properties-values-api/at-property.html> https://wpt.fyi/
> css/css-properties-values-api/register-property-syntax-parsing.html
> <https://wpt.fyi/css/css-properties-values-api/register-property-syntax-
> parsing.html> https://wpt.fyi/css/css-properties-values-api/typedom.html
> <https://wpt.fyi/css/css-properties-values-api/typedom.html>
>
>
>
> Flag name on chrome://flags
>
> #enable-experimental-web-platform-features
>
>
> Finch feature name
>
> CSSVariables2ImageValues
>
>
> Requires code in //chrome?
>
> False
>
>
> Estimated milestones
>
> Shipping on desktop 120
> DevTrial on desktop 115
>
> Shipping on Android 120
> DevTrial on Android 115
>
>
>
> 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/5142205606133760 <https://
> chromestatus.com/feature/5142205606133760>
>
> This intent message was generated by Chrome Platform Status <https://
> chromestatus.com/>.
>
> --
> Rune Lillesveen
>
> --
> 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 <mailto:blink-
> dev+uns...@chromium.org>.
> To view this discussion on the web visit https://groups.google.com/a/
> chromium.org/d/msgid/blink-dev/
> CACuPfeRmvmaqY%3DR8fx1%3Dr_ezTjevZR%3DyAg82E9Z3w8YXBB%2Bo_A%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeRmvmaqY%3DR8fx1%3Dr_ezTjevZR%3DyAg82E9Z3w8YXBB%2Bo_A%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Mike Taylor

unread,
Oct 11, 2023, 10:08:02 AM10/11/23
to Daniel Bratell, Rune Lillesveen, blink-dev

Chris Harrelson

unread,
Oct 11, 2023, 10:39:09 AM10/11/23
to Mike Taylor, Daniel Bratell, Rune Lillesveen, blink-dev

Yoav Weiss

unread,
Oct 11, 2023, 10:39:42 AM10/11/23
to blink-dev, Mike Taylor, Daniel Bratell, Rune Lillesveen
LGTM3

On Wednesday, October 11, 2023 at 4:08:02 PM UTC+2 Mike Taylor wrote:

LGTM2

On 10/11/23 7:06 AM, Daniel Bratell wrote:

LGTM1

(Privacy and Security steps in Chromestatus are not completed but they are unlikely to affect anything)

/Daniel

On 2023-10-04 12:23, Rune Lillesveen wrote:
On Wed, Oct 4, 2023 at 11:08 AM Rune Lillesveen <fut...@chromium.org> wrote:


--
Rune Lillesveen

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
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+unsubscribe@chromium.org.

Rune Lillesveen

unread,
Oct 12, 2023, 9:49:01 AM10/12/23
to Emilio Cobos Álvarez, blink-dev
On Wed, Oct 11, 2023 at 3:50 PM Emilio Cobos Álvarez <emi...@mozilla.com> wrote:
FWIW we don't ship this (outside of the nightly channel), so not sure
where the gecko status is coming from, but it's not accurate.

Yes, I corrected that in my previous reply and updated the chromestatus entry accordingly.


--
Rune Lillesveen

Reply all
Reply to author
Forward
0 new messages