Intent to Implement and Ship: CSS Color 4 HSL{A} Syntax

39 views
Skip to first unread message

Chris Nardi

unread,
Dec 7, 2017, 9:35:36 AM12/7/17
to blink-dev

Contact emails

Chris Nardi (csna...@gmail.com)


Summary

This is a follow up to https://groups.google.com/a/chromium.org/d/msg/blink-dev/rbkgdTPBCbM/a71S7rukBgAJ.


CSS Color 4 introduces a new syntax for HSL{A}, which separates the parameters with whitespace, and separates the alpha value with a backslash. CSS Color 4 also makes HSL and HSLA synonyms of each other, meaning the alpha value is an optional parameter in each. The hue parameter is expanded to include angles as well as numbers. Additionally, the alpha parameter is expanded to include percentages as well. The legacy HSL{A} syntax with commas is still preserved.


As there is already an internal representation for HSL{A} colors (RGB{A}), no changes to serialization will occur.


Design Doc/Spec

https://drafts.csswg.org/css-color/#the-hsl-notation


Motivation

While this wouldn't necessarily significantly improve the web developer experience, it does make it easier as the functions are now interchangeable, no commas are required, the hue can be specified as an angle, and percentages would no longer need to be converted to a decimal for the alpha value.


Risks

Interoperability and Compatibility

There should be no compatibility risk, as the legacy syntax is still supported. No functional changes would occur to already valid code; the only change would be that previously invalid code would now be parsed.


Edge: No signals

Firefox: Shipped (https://bugzilla.mozilla.org/show_bug.cgi?id=1295456)

Safari: No signals

Web developers: Unclear


Ergonomics

n/a


Activation

The changes would be easy for web developers to use.


Debuggability

The color picker might need to be updated to support this syntax, but that should be the only change needed.


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?

Not yet. I created https://github.com/w3c/web-platform-tests/pull/8598 to include HSL{A} tests in CSS Color, but this has not been merged yet.


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5656221012983808


Requesting approval to ship?

Yes.

Daniel Bratell

unread,
Dec 7, 2017, 11:13:28 AM12/7/17
to blink-dev, Chris Nardi
This request could probably have been bundled with RGB{A} but hindsight is rarely available in advance.

LGTM1 

/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/CAFPMNr%3DvdMbV3Kfn9n5AMPnoDuWq_rhMqrjJCRfsyo1MzhzSHw%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Chris Harrelson

unread,
Dec 7, 2017, 12:43:05 PM12/7/17
to Daniel Bratell, blink-dev, Chris Nardi
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/op.zavwn2lyrbppqq%40cicero2.linkoping.osa.

Rick Byers

unread,
Dec 8, 2017, 7:38:30 PM12/8/17
to Chris Harrelson, Daniel Bratell, blink-dev, Chris Nardi
LGTM3

Please make sure the WPT lands when this is turned on.  You can get whoever reviews your chromium CL to review the test (in GitHub or via chromium auto export). If GitHub then I or anyone on #testing can merge the commit after it's been reviewed by someone with expertise on the feature (avoiding this beurocracy is one of the benefits of using auto-export from chromium).

Reply all
Reply to author
Forward
0 new messages