Intent to Implement: CSS Paint API

146 views
Skip to first unread message

Ian Kilpatrick

unread,
Jan 22, 2016, 9:07:57 PM1/22/16
to blink-dev

Contact emails

ikilp...@chromium.org


Spec

https://drafts.css-houdini.org/css-paint-api/


Summary

The CSS Paint API defines a new way for developers to draw content into a CSS <image> during the paint phase of the rendering engine.


Motivation

This spec was developed as part of the CSS Houdini effort in order to "explain CSS" in line with the extensible web manifesto.


This API will allow developers to polyfill new CSS features such as cross-fade(), radial-gradient() in addition to developing their own features.


Without this specification, in order to generate custom CSS paint effects developers need to do a lot of "fighting" with the browser. These include:

  • Trying to trigger a paint based off a style invalidation.

  • Trying to know when an element has been resized to repaint.

  • Trying to know when to paint (if the element is visible or not).

  • Trying to ensure a canvas element is in the appropriate stacking context visually.


This specification allows future optimizations by the user-agent including caching results between frames, moving work off thread(s), only painting things inside the visible viewport.


Interoperability and Compatibility Risk

Compatibility Risk: None, adding a new primitive to the web platform.

Interoperability Risk: None (yet). Not requesting permission to ship. Implementing the CSS Paint API is meant to inform the current specification, and allow experimentation. By informing the specification we hope that this will allow us to ship a version of this API which is interoperable with other browsers.


Ongoing technical constraints

None. The CSS Paint API is being built on top of Worklets which don’t specify which thread the code is executed on. This won’t prevent us in the future from moving our paint drawing code to a separate thread.


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

Yes.


OWP launch tracking bug

https://crbug.com/578252


Link to entry on the feature dashboard

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


Requesting approval to ship?

No.


Mike Lawther

unread,
Jan 25, 2016, 12:55:15 AM1/25/16
to Ian Kilpatrick, blink-dev
I'm really excited to see this progress, for all the reasons you've already listed in the motivation section.

Non-owner lgtm!


Philip Jägenstedt

unread,
Jan 26, 2016, 12:34:07 AM1/26/16
to Mike Lawther, Ian Kilpatrick, blink-dev
No LGTM required to implement, but this looks great!

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

poonyawee...@gmail.com

unread,
Sep 18, 2017, 5:12:55 PM9/18/17
to blink-dev, mikel...@chromium.org, ikilp...@chromium.org, phi...@opera.com


เมื่อ วันอังคารที่ 26 มกราคม ค.ศ. 2016 12 นาฬิกา 34 นาที 07 วินาที UTC+7, Philip Jägenstedt เขียนว่า:
Reply all
Reply to author
Forward
0 new messages