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: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 7 Nov 2012 06:56:15 -0800
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org list" <www-style@w3.org>
Message-ID: <2A4BBE45-CD1E-45B0-AF83-8691C00D0747@adobe.com>

On Nov 7, 2012, at 4:24 AM, Robert O'Callahan <robert@ocallahan.org> wrote:

> 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.

That doesn't sound right for me. 'mask-image' should get CSS images IMO. Both, the keyword and the selector are just other ways to reference <mask> elements.

> 
>> 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.

There is more then that. You need to take care of cross fading, transitions and animations. Cross fading is already supported in WebKit and will be defined in CSS4 Images or a following specification. This would not work with SVG masks. Again, in WebKit 'mask-image' and SVG masks are separate code paths that can't easily be combined.

> 
>> 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)".

I don't think we should go this way. 'mask-image' already implies that it takes an image. <mask> definitely is not an image.

> 
> 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?

Sounds reasonable. I will change the text. Thanks for the feedback.

Greetings,
Dirk

> 
> 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 14:56:44 GMT

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