[css-houdini-drafts] [typed-om] Trim CSSResourceValue and subclasses to opaque objects for this level, punt rest to level 2

tabatkins has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [typed-om] Trim CSSResourceValue and subclasses to opaque objects for this level, punt rest to level 2 ==
There's a bunch of undefined behavior around loading, urls, and such of CSSResourceValue right now.  Doing it right will require some careful design and probably some research (and probably go hand-in-hand with speccing out these behaviors in more detail for CSS in general).  This isn't compatible with shipping level 1 in the near future.

I'd be inclined to punt the entire thing, but Custom Paint relies on CSSImageValue to pipe images into the PaintWorker (tho there's apparently some HTML edits that need to be made, paging @bfgeek).

So, I propose that for this level, we pare it down to the bare minimum we need to represent an image, for Custom Paint purposes.  That means removing CSSURLImageValue entirely, and removing all the attributes (state, intrinsicWidth/Height/Ratio) from the classes.  We'll be left with an opaque handle to an image value that doesn't expose *any* information about the loading pipeline, and which can only be obtained from CSS itself (no constructor anymore!), so all the undefined behavior is just what CSS already has undefined.

According to @bfgeek, this should be fine.  It does negate one of his use-case examples (rendering with a fallback image), but that's fine for now; most Custom Paint stuff is fine just spamming the CSSImageValue into the canvas, even if it's currently not loaded, and just getting called back when it is loaded and drawing it correctly.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/716 using your GitHub account

Received on Thursday, 22 February 2018 23:44:35 UTC