Re: [css-masking] when to interpret 'mask-image' as SVG mask vs. image?

On Thu, Nov 5, 2015 at 6:16 AM, L. David Baron <dbaron@dbaron.org> wrote:
> https://drafts.fxtf.org/css-masking-1/#the-mask-image defines a
> property that can use the url() function to link to either an SVG
> mask element or to an image.
>
> I don't see where it specifies how to tell which one of these two to
> process a link as.
>
> This ought to be defined clearly.
>
> (I have vague memories of it being discussed in a working group
> meeting, but I couldn't find the minutes.)

This was discussed back when we were talking about referencing SVG
paint servers in CSS.

There wasn't a firm conclusion, iirc.  There were two serious
suggestions that I recall:

1. Let url() continue to refer to the document as an image, with a
hash just activating :target semantics.  Let element() take a url()
with a hash, and definitely refer to an element within that document.

2. Let url() do both.  When loading a url() with a hash that returns
an SVG document, check if the hash points to a paint server or similar
non-rendered but referencable thing in SVG, such as a <mask>.  If so,
interpret it as the appropriate thing.  Otherwise, interpret it as an
image.

IIRC, the second was preferable, but was not friendly to image-loading
pipelines in browsers, which need to know at load time whether to load
something "as an image" or "as a document".  I *think* roc had some
opinions about it not being too bad, but I don't recall it well.

~TJ

Received on Tuesday, 8 December 2015 23:30:54 UTC