Re: [css-houdini-drafts] [css-paint-api] Cycle possible using inputProperties() (#877)

I tried to create [an example](https://recursive-pw.glitch.me) of this to test current behavior and found that it does not work. PaintRenderingContext2D.drawImage accepts CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas, but paint, gradient and crossfade are type CSSImageGeneratorValue. Since CSSImageGeneratorValue is not specified in CSSOM yet, we get a [CSSStyleValue](https://drafts.css-houdini.org/css-typed-om/#stylevalue-objects) in the worklet which supports toString() but can't be drawn.

The drawImage call fails with:
```
painters.js:15 Uncaught TypeError: Failed to execute 'drawImage' on 'PaintRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'
```

Since it seems it currently isn't possible I imagine we don't need a resolution until we get to exposing CSSImageGeneratorValue to PaintWorklet.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/877#issuecomment-487727155 using your GitHub account

Received on Monday, 29 April 2019 20:16:21 UTC