|
|
|
|
|
by Aaron1011
3076 days ago
|
|
> As of now, text rendering methods are missing and for security reasons you cannot read back pixels from the canvas. Does anyone have an idea as to what those reasons might be? I've heard of JavaScript access to certain CSS features being limited (e.g. getComputedStyle()), but I'm not sure what the benefit is here. Is there any way that user information could be leaked through a paint worklet context? |
|
The primary reason we did this is to ensure there wasn't a performance cliff if you did read-back pixels. With the current API surface you can record all of the canvas commands, and play them back when you need to raster. Additionally it doesn't leak how many pixels we are actually rastering to.
(hope this helps).