Gpuweb: Feature Request: CSS ‘fragment: url(“/post.frag”);’ rule

Created on 20 May 2020  Â·  2Comments  Â·  Source: gpuweb/gpuweb

This may be out of scope or already requested however it would be very useful to extend the CSS spec in tandem to include an interface to run rendered DOM content through a fragment shader (ideally images) via a rule.

feature request

Most helpful comment

There was actually a similar proposal - and even implemented in Chromium - somewhere in 2012.

This is indeed outside the scope of WebGPU and would find a better place in the CSS WG.

All 2 comments

There was actually a similar proposal - and even implemented in Chromium - somewhere in 2012.

This is indeed outside the scope of WebGPU and would find a better place in the CSS WG.

Generally speaking, there are significant security issues with allowing arbitrary fragment shader code to be run against DOM contents - it's for this reason that we never allowed DOM-to-Texture in WebGL (even with some kind of "tainted" flag like is used for CORS images in 2D canvas (i.e. "you can't read back from this canvas anymore"). It's easy to write a fragment shader whose timing depends on the DOM contents, which can include CORS images, visited-link state, etc. The timing side channel can then be read from JS by looking at frame timing. Though in this case, I think you could implement this so it doesn't affect layout time (time between rAF and rPostAF), only the rAF rate (60, 30, etc.)

I agree this should go to the CSS WG. Please link between these two threads if you open an issue there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kvark picture kvark  Â·  5Comments

kvark picture kvark  Â·  5Comments

krogovin picture krogovin  Â·  5Comments

dneto0 picture dneto0  Â·  6Comments

kainino0x picture kainino0x  Â·  6Comments