css-houdini-drafts
css-houdini-drafts copied to clipboard
[css-paint-api] Invalidate paint when `devicePixelRatio` changes?
From step 10 of https://drafts.css-houdini.org/css-paint-api-1/#invoke-a-paint-callback
At this stage the user agent may re-use an image from a previous invocation if paintSize, styleMap, inputArguments are equivalent to that previous invocation.
Should this include devicePixelRatio? It isn't clear to me how/why you'd use devicePixelRatio in CSS paint, but it's a bit of paint-relevant state that's available to the worker, and it may change.
We don't take the dpr into account when sizing the canvas currently, and you can't adjust the canvas size yourself either, so i'm not sure what re-rendering on dpr change would achieve.
It's a piece of data that's available to the paint API , and that data changes over time.
Maybe dpr should be removed from the global instead? Why is it there?