W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: [css-masking] 'mask' with resource and image references (was: [css4-images] support for SVG Paint Servers without element())

From: Robert O'Callahan <robert@ocallahan.org>
Date: Thu, 8 Nov 2012 01:24:26 +1300
Message-ID: <CAOp6jLY5jicxB0D=hanHYZKsu+nFX0AAnTSWVABCj+uoWZafAQ@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org list" <www-style@w3.org>
On Wed, Nov 7, 2012 at 3:14 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> On Nov 6, 2012, at 5:06 PM, Robert O'Callahan <robert@ocallahan.org>
> wrote:
> > Just remove the <mask-source> alternative. "mask:url(foo.svg#abc)" gets
> parsed to a mask-image value of url(foo.svg#abc). When rendering, since the
> mask-image value is a url() with a fragment identifier, it should be
> treated as a reference to an SVG <mask>.
>
> This is difficult because of multiple reasons:
>
> <mask-source> does not only allow URLs, but also the 'child' keyword and
> the child selector.
>

So add those separately as alternatives for mask-image.

The image on the 'mask-image' property gets clipped by the 'mask-clip'
> property, repeated by the 'mask-repeat' property and positioned by the
> 'mask-origin' property. All these properties do not apply on <mask>
> references.
>

That's not a problem as far as I can tell. When mask-image refers to a
<mask>, mask-repeat, mask-clip and mask-origin simply won't apply.

A combination of images and mask references for the 'mask-image' property
> is not defined by the model for 'mask-image'. It is unclear how both can be
> combined and I actually don't think that this is a very good idea. Both
> 'mask-image' and <mask> have there use cases independent of each other.
>

We need to define what happens if you combine images and mask references,
but we can define something simple like "if any of the values in a
mask-image list is an image, all the values that are not images are ignored
(treated as not masking anything)".

BTW it's not quite clear to me how the spec defines rendering of multiple
mask images. "All mask images are transformed to alpha masks (if necessary)
and combined by compositing on the mask." Does that mean we composite all
the mask images together with operator OVER and then use the result as the
mask? If so, it could be written more clearly. Also, are there actual
use-cases for multiple mask images?

Rob
-- 
Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]
Received on Wednesday, 7 November 2012 12:24:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:02 GMT