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

So, issue here.

Say you have a property like 'mask-image'. It takes a url().  This url() is *either* an `<image>` or a `<mask-source>`.  The former wants to expose width/height/ratio; the latter might want to expose some sort of information from the `<mask>` element.  You can't tell which thing a `url()` is until *after* the URL resolves!  This means that we can't tell what type to reify the value to until after network activity has happened.

@bfgeek's suggestion: in L2, have a CSSURLValue class, representing a network resource more generally, and give it a promise-returning method that gives back a concrete object representing the actual resource that was fetched. (Or lets you choose to parse it in a particular way? That way you could point to an SVG file and get it as an image *or* a reference, depending on your needs.)

This problem might infect general `<image>` usage too, if we ever let people point to SVG `<linearGradient>` and use it the same way as `linear-gradient()`.

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

Received on Saturday, 24 February 2018 00:25:34 UTC