Re: Properties of Custom Paint

>
> As I've said to Shane and Ian offline, I think that a variant on the
> element() feature can address many of the requirements for custom paint
> with a few API modifications (allowing it to be used in more places, in
> addition to default rendering, responding to layout updates, etc). We've
> found -webkit-canvas to be especially useful in this manner (we use it for
> the custom rendering of our scrubber bar in media controls).
>

One concern I have with this is that if you register the same canvas to
multiple elements, you're stuck with a single canvas size. So you can't
really build a custom painter that e.g. paints a fancy border for any given
size input - instead, you'd need to create a new <canvas> element that
shadows every fancy border instance, so that each could be responsive
independently to layout.

In fact, I'd like to propose an extra "Required Property" for Ian's list:
Custom Paint functions can be shared across multiple elements

One potential solution is to either allow element() to reference paint
functions directly (rather than just out-of-dom canvases), or to add a new
CSS function for this purpose (e.g. paint()).

Cheers,
    -Shane

Received on Thursday, 21 May 2015 19:39:27 UTC