Intent to Ship: Canvas and Text system colors

1,313 views
Skip to first unread message

Alison Maher

unread,
Oct 21, 2019, 12:17:27 PM10/21/19
to blin...@chromium.org, Rossen Atanassov

Contact emails
alm...@microsoft.com, ra...@microsoft.com 

 

Explainer

N/A

 

Spec

https://drafts.csswg.org/css-color-4/#css-system-colors

 

Summary

Support for the new system color keywords, Canvas and Text, from CSS Color Module ‌Level 4. Canvas maps to the existing Window system color keyword, and Text maps to the existing WindowText system color keyword.

 

Link to “Intent to Implement” blink-dev discussion

N/A

 

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

Yes, the keywords themselves will be supported on all platforms, but they will only evaluate to associated system colors on Windows and Mac.

 

Note: Text has already been exposed as a system color keyword on Mac.

 

Risks

Interoperability and Compatibility

Firefox: No public signals

Edge: No public signals

Safari: No public signals

Web developers: No public signals

 

           Ergonomics

At this time, Canvas and Text will be supported in tandem with Window and WindowText. As such, Canvas and Text can be thought of as aliases for Window and WindowText.

 

Security

System color keywords can be used for fingerprinting as they can be used to expose a user preference. However, Canvas and Text do not add any additional security threats since Window and WindowText are already exposed.

(https://drafts.csswg.org/css-color-4/#priv-sec)

 

Demo

Sample HTML:

    <style>

        body {

            background: Canvas;

            color: Text;

        }

    </style>

    <body>

          Sample text.

    </body>

 

 

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

No, since system colors are platform dependent, web-platform tests were not added. Canvas and Text are tested, along with the other system color keywords, in internal Chromium web tests and browser tests.

 

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1015968

 

Entry on the feature dashboard

N/A

 

Related CL

https://chromium-review.googlesource.com/c/chromium/src/+/1864378

 

Joe Medley

unread,
Oct 21, 2019, 12:27:35 PM10/21/19
to Alison Maher, blin...@chromium.org, Rossen Atanassov
Can you please create a status entry for this?

Thanks,
Joe
Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.


--
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/DM5PR00MB0407F4AB72EB2AD4A90392978A690%40DM5PR00MB0407.namprd00.prod.outlook.com.

Joe Medley

unread,
Oct 22, 2019, 12:11:57 PM10/22/19
to blink-dev, Rossen.A...@microsoft.com, Alison...@microsoft.com
Alison,

Avi Drissman tells me you don't have access to create Chrome Status entries. I fixed that. You won't get an autonotice (I don't think). The login link is in the page footer. After logging in you should see a button on the top right labeled "Add new feature". Email me directly if you have trouble.

Joe

alm...@microsoft.com

unread,
Oct 22, 2019, 3:23:54 PM10/22/19
to blink-dev, Rossen.A...@microsoft.com, Alison...@microsoft.com

Thanks Joe! I’ve added a new Chrome Status entry for Canvas and Text: https://www.chromestatus.com/feature/5678291530809344


On Monday, October 21, 2019 at 9:17:27 AM UTC-7, Alison Maher wrote:

Joe Medley

unread,
Oct 22, 2019, 5:43:51 PM10/22/19
to alm...@microsoft.com, blink-dev, Rossen Atanassov, Alison Maher
Thanks.

Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.

--
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.

Daniel Bratell

unread,
Oct 23, 2019, 1:21:05 PM10/23/19
to blin...@chromium.org

Good seeing more of CSS 4 coming. Some comments though.

There should have been a section with a link to a TAG review or alternatively an explanation why a TAG review is not necessary. I suspect that you think the latter, but it needs to be there to save us time.

I think there are probably some things you can test with Web Platform Tests even if the pixel output will be unpredictable. Things like parsing and serialization of of color values for instance. Quite possibly there are already similar tests that can be expanded. If they are also to be equivalent to other values, it will be possible to test that they are treated the same (if that is not an implementation detail).

Interoperability is important so you should see if you can get other vendors to pick up this. I suspect it might not be that hard to implement so if you only get their attention, they might react positively, or maybe know of a good reason for not to implement it. At the very least you can make sure webkit and mozilla both have bugs to track this feature and link them here.

/Daniel

alm...@microsoft.com

unread,
Oct 23, 2019, 7:30:20 PM10/23/19
to blink-dev, Rossen.A...@microsoft.com, Alison...@microsoft.com
Thanks for the feedback, Daniel. I have updated the message below to include your suggestions.

To summarize:
- Canvas and Text are aliases for existing system color keywords, so a TAG review is not needed.
- A WPT test for parsing/serialization has been added to the in-progress CL: https://github.com/web-platform-tests/wpt/pull/19856
- I have filed bugs with mozilla and webkit to track this feature: https://bugzilla.mozilla.org/show_bug.cgi?id=1590894https://bugs.webkit.org/show_bug.cgi?id=203319

On Monday, October 21, 2019 at 9:17:27 AM UTC-7, Alison Maher wrote:

Contact emails
alm...@microsoft.com, ra...@microsoft.com 

 

Explainer

N/A

 

Spec

https://drafts.csswg.org/css-color-4/#css-system-colors

 

Summary

Support for the new system color keywords, Canvas and Text, from CSS Color Module ‌Level 4. Canvas maps to the existing Window system color keyword, and Text maps to the existing WindowText system color keyword.

 

Link to “Intent to Implement” blink-dev discussion

N/A

 
  TAG Review
  Canvas and Text are aliases for existing system color keywords, so a TAG review is not needed. 

 

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

Yes, the keywords themselves will be supported on all platforms, but they will only evaluate to associated system colors on Windows and Mac.

 

Note: Text has already been exposed as a system color keyword on Mac.

 

Risks

Interoperability and Compatibility

Firefox: No public signals

                              A bug has been filed to track this feature: https://bugzilla.mozilla.org/show_bug.cgi?id=1590894 

Edge: No public signals

Safari: No public signals

                             A bug has been filed to track this feature: https://bugs.webkit.org/show_bug.cgi?id=203319

Web developers: No public signals

 

           Ergonomics

At this time, Canvas and Text will be supported in tandem with Window and WindowText. As such, Canvas and Text can be thought of as aliases for Window and WindowText.

 

Security

System color keywords can be used for fingerprinting as they can be used to expose a user preference. However, Canvas and Text do not add any additional security threats since Window and WindowText are already exposed.

(https://drafts.csswg.org/css-color-4/#priv-sec)

 

Demo

Sample HTML:

    <style>

        body {

            background: Canvas;

            color: Text;

        }

    </style>

    <body>

          Sample text.

    </body>

 

 

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

    Web-platform tests for the parsing and serialization of Canvas and Text have been added (https://github.com/web-platform-tests/wpt/pull/19856).
 

Since system colors are platform dependent, web-platform tests for the calculation of system colors were not added. Instead, the calculation of Canvas and Text are tested, along with the other system color keywords, in internal Chromium web tests and browser tests.

 

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1015968

 

Entry on the feature dashboard

alm...@microsoft.com

unread,
Oct 30, 2019, 5:13:41 PM10/30/19
to blink-dev, Rossen.A...@microsoft.com, Alison...@microsoft.com
Text has recently been updated to CanvasText. The content below is now updated to reflect the rename.



On Wednesday, October 23, 2019 at 4:30:20 PM UTC-7, Alison Maher wrote:
Thanks for the feedback, Daniel. I have updated the message below to include your suggestions.

To summarize:
- Canvas and CanvasText are aliases for existing system color keywords, so a TAG review is not needed.
- A WPT test for parsing/serialization has been added to the in-progress CL: https://github.com/web-platform-tests/wpt/pull/19856
- I have filed bugs with mozilla and webkit to track this feature: https://bugzilla.mozilla.org/show_bug.cgi?id=1590894https://bugs.webkit.org/show_bug.cgi?id=203319

On Monday, October 21, 2019 at 9:17:27 AM UTC-7, Alison Maher wrote:

Support for the new system color keywords, Canvas and CanvasText, from CSS Color Module ‌Level 4. Canvas maps to the existing Window system color keyword, and CanvasText maps to the existing WindowText system color keyword.

 

Link to “Intent to Implement” blink-dev discussion

N/A

 
  TAG Review
  Canvas and CanvasText are aliases for existing system color keywords, so a TAG review is not needed. 

 

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

Yes, the keywords themselves will be supported on all platforms, but they will only evaluate to associated system colors on Windows and Mac.

 

Risks

Interoperability and Compatibility

Firefox: No public signals

                              A bug has been filed to track this feature: https://bugzilla.mozilla.org/show_bug.cgi?id=1590894 

Edge: No public signals

Safari: No public signals

                             A bug has been filed to track this feature: https://bugs.webkit.org/show_bug.cgi?id=203319

Web developers: No public signals

 

           Ergonomics

At this time, Canvas and CanvasText will be supported in tandem with Window and WindowText. As such, Canvas and CanvasText can be thought of as aliases for Window and WindowText.

 

Security

System color keywords can be used for fingerprinting as they can be used to expose a user preference. However, Canvas and CanvasText do not add any additional security threats since Window and WindowText are already exposed.

(https://drafts.csswg.org/css-color-4/#priv-sec)

 

Demo

Sample HTML:

    <style>

        body {

            background: Canvas;

            color: CanvasText;

        }

    </style>

    <body>

          Sample text.

    </body>

 

 

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

    Web-platform tests for the parsing and serialization of Canvas and CanvasText have been added (https://github.com/web-platform-tests/wpt/pull/19856).
 

Since system colors are platform dependent, web-platform tests for the calculation of system colors were not added. Instead, the calculation of Canvas and CanvasText are tested, along with the other system color keywords, in internal Chromium web tests and browser tests.

Daniel Bratell

unread,
Oct 31, 2019, 3:19:52 PM10/31/19
to alm...@microsoft.com, blink-dev, Rossen.A...@microsoft.com, Alison...@microsoft.com

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.

Alex Russell

unread,
Oct 31, 2019, 4:15:34 PM10/31/19
to blink-dev, alm...@microsoft.com, Rossen.A...@microsoft.com, Alison...@microsoft.com
Hey Alison,

Some dumb questions as this feature is a long way from my area of expertise:
  • Do we have CSS WG resolutions that provide support for this design, or other public discussion of the design? Not having a TAG review filed is a bit of a risk factor, so I'd like to understand how "safe" this is.
  • Is there any chance that the "Canvas" == "Window" and "Text" === "Window Text" equivalence will become unmoored in the future? Could they diverge?
  • Do we know if this will cause any compat issues?
Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.

alm...@microsoft.com

unread,
Oct 31, 2019, 7:21:31 PM10/31/19
to blink-dev, alm...@microsoft.com, Rossen.A...@microsoft.com, Alison...@microsoft.com
Hi Alex,

Those are great questions. The answers can be found below in yellow. Please let me know if I can answer or clarify anything else.

On Thursday, October 31, 2019 at 1:15:34 PM UTC-7, Alex Russell wrote:
Hey Alison,

Some dumb questions as this feature is a long way from my area of expertise:
  • Do we have CSS WG resolutions that provide support for this design, or other public discussion of the design? Not having a TAG review filed is a bit of a risk factor, so I'd like to understand how "safe" this is.
The CSSWG resolution for undeprecating the system colors can be found here: https://github.com/w3c/csswg-drafts/issues/3804#issuecomment-486325470.
The CSSWG resolution for renaming "Text" to "CanvasText" can be found here: https://github.com/w3c/csswg-drafts/issues/4465#issuecomment-547994485
  • Is there any chance that the "Canvas" == "Window" and "Text" === "Window Text" equivalence will become unmoored in the future? Could they diverge?
"Window" and "WindowText" were previously deprecated in the spec, but they continued to be supported as keywords as to not introduce any compat issues.

In undeprecating these values, "Canvas" and "CanvasText" were proposed by the CSSWG as new names for "Window" and "WindowText". Thus, the decision to make these values equivalent to one another is due to the fact that they are true aliases.

In terms of their actual color calculation, from the point of view of Windows, we don't foresee any possibility of divergence. It certainly has been the case for the past 20+ years.
  • Do we know if this will cause any compat issues? 
Since "Canvas" and "CanvasText" are new additions to CSS, we don't anticipate compat issues. Additionally, "Window" and "WindowText" will continue to be supported as to not introduce any further compat issues.
 
Thanks

Chris Harrelson

unread,
Oct 31, 2019, 7:32:40 PM10/31/19
to alm...@microsoft.com, blink-dev, Rossen Atanassov, Alison...@microsoft.com
Thanks for these links and clarifications.

LGTM2

--
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/3322e1db-129d-4637-9e13-b8ca10155453%40chromium.org.

Yoav Weiss

unread,
Nov 3, 2019, 5:42:43 AM11/3/19
to Chris Harrelson, alm...@microsoft.com, blink-dev, Rossen Atanassov, Alison...@microsoft.com
LGTM3 given the clarifications and encouraging discussion on the Firefox issue

Reply all
Reply to author
Forward
0 new messages