Re: [css-houdini-drafts] [css-typed-om] CSSURLImageValue

So here's the wrinkles:

1. A url like `url(#foo)` must be kept as `#foo` exactly - fragment references are always parsed against the current document's URL, even if it changes, rather than being eagerly resolved against some particular base URL.  (This allows frags-as-internal-references to always work regardless of whatever shenanigans you pull with the document's url.)

2. A relative url like `url(foo)` is resolved eagerly against some particular base URL; in a stylesheet the base URL is the stylesheet's own URL.  If we hew close to this, it implies we should keep relative urls unresolved, and only resolve them when the values are actually .set() into a rule somewhere.

We can maybe ditch (2) and just find some reasonable base url to resolve against. (I went looking for precedent and found that, whoops, it's just completely unspecified for the FontFace object. Filed <https://github.com/w3c/csswg-drafts/issues/2343>.) In fact, it's probably better to do so - the base-url behavior in stylesheets is often kinda confusing, and having it vary based on exactly where you're setting would probably be confusing to authors.

(1) is at least easy to recognize - if it starts with a `#`, we can just leave it unparsed.  That functionality is necessary, so we can't remove it.

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

Received on Thursday, 22 February 2018 01:10:09 UTC