Re: [cssom] Serializing url values

On Mon, Dec 16, 2013 at 2:53 PM, Bear Travis <betravis@adobe.com> wrote:
> Hi All,
>
> I had a quick question about how url values are serialized for the image
> type [1] (or in general).
>
> The questions I have are:
> 1. Does the serialized version of the url() notation quote its URL? Does it
> preserve the quoted form of the URL? The spec allows for optionally single
> or double quoting it [2].

CSSOM specifies double-quoting.

> 2. Are relative URLs resolved to absolute URLs?

Yes, this is part of transitioning the URL to a computed value.  Note
that we don't currently well-define what it means to absolutize a URL;
this'll be fixed soon by me migrating the V&U spec over to using the
URL standard instead of an inadequate RFC.  It's also explicitly
instructed by CSSOM when serializing a <uri>.

> For the last point, I’m unclear on whether the url notation would follow the
> “Serialize a URL” common idiom [3] or “Serialize a URI” component value [4]
> rule, as neither seems to be a perfect fit. To me, the best fit definition
> would be a url function taking either a string or a uri, but I did not see a
> general rule for serializing functions.

The "serialize a URL" idiom is just a definition invoked locally by
the spec.  When you serialize a CSS value, use the
#serialize-a-css-value definition; the <uri> clause defines how to
serialize it.  (It just invokes the "serialize a URL" definition.)

~TJ

Received on Tuesday, 17 December 2013 01:13:02 UTC