3 ms·
I've written some prototypes using Paint Worklet that run in both Safari and Chrome. Safari has an experimental API called -webkit-canvas that's very similar t
by bsimpson 9y ago
I've written some prototypes using Paint Worklet that run in both Safari and Chrome.
Safari has an experimental API called -webkit-canvas that's very similar to Paint Worklet. You can use it to write code that runs in either engine pretty easily.
I've just thrown together a gist outlining how to do so:
https://gist.github.com/appsforartists/e5d2a4b7826bf5962fad142bcd255465 https://gist.github.com/appsforartists/e5d2a4b7826bf5962fad1...
It's not quite a polyfill, because -webkit-canvas doesn't automatically repaint when you change an input property. Otherwise, it would be pretty simple to write one.
I may write a proper tutorial at some point. Hopefully this gives other interested folks a push in the right direction, in the mean time.