Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paintAPI (houdini) #160

Closed
jsnkuhn opened this issue Sep 27, 2022 · 2 comments
Closed

paintAPI (houdini) #160

jsnkuhn opened this issue Sep 27, 2022 · 2 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@jsnkuhn
Copy link

jsnkuhn commented Sep 27, 2022

Description

from spec:

The CSS Paint API is being developed to improve the extensibility of CSS.

Specifically this allows developers to write a paint function which allows us to draw directly into an elements background, border, or content.

from Mozilla:

This specification allows developing prototypes of new graphical CSS features and provides an escape hatch for developers when the existing features aren't good enough for a particular piece of a web page.

Rationale

chromium: implemented
safari ("in development"): https://bugs.webkit.org/show_bug.cgi?id=190217
firefox ("under consideration"): https://bugzilla.mozilla.org/show_bug.cgi?id=1302328

  • There's a polyfill (https://github.com/GoogleChromeLabs/css-paint-polyfill)
    but must admit that it hasn't performed so great for me. Sometimes just flat out doesn't respond in Firefox at all. Maybe because it piggy backs on -moz-element() which isn't fully implemented in FF? FYI, have filed some bugs for the polyfill and got responses/fixes from the dev

Including the polyfill sometimes kills the benefits of the paintAPI. One of the big paintAPI wins is complex images in a small size. If you have to include an extra file download (the poylfill) to make it work than the overall file size associated with the worklet becomes larger and you might just be better off using an image. Cross browser support would fix this.

  • https://houdini.how/
    Lots of demos. Chrome folks are using paintAPI to polyfill native material UI bits not yet available in CSS

  • personally attempting to make a "full" polyfill for the CSS corner-shape spec (which has been stalled for about 10 years at this point) with the paintAPI. Got to a point working on the worklet where I was spending more time trouble shooting bugs with the polyfill than working on the worklet itself. Considering making a v.2 of the worklet just for fully supported browsers. Thinking in the future v.1 (with the polyfil fill) can just be replaced. Work in progress demo: https://jsnkuhn.github.io/corner-shape/

Specification

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

Tests

lots and lots of tests:

https://wpt.fyi/results/css/css-paint-api?label=experimental&label=master&aligned&view=subtest

@jsnkuhn jsnkuhn added the focus-area-proposal Focus Area Proposal label Sep 27, 2022
@gsnedders gsnedders added this to the Interop 2023 milestone Sep 28, 2022
@foolip foolip removed this from the Interop 2023 milestone Oct 7, 2022
@foolip
Copy link
Member

foolip commented Nov 11, 2022

In the MDN short survey on CSS & HTML, "Custom Paint API (Paint Worklet)" was selected by ~11% of survey takers, putting it in the bottom third of the 20 options. (There is some uncertainty as with any survey data.)

@nairnandu
Copy link
Contributor

Thank you for proposing paintAPI for inclusion in Interop 2023.

We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. This should not be taken as a comment on the technology as a whole, and resubmitting a proposal for this feature as part of a future round of Interop would be welcome.

For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

4 participants