W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2013

Re: [css-masking] High-level comments

From: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 3 Apr 2013 21:08:39 -0700
To: fantasai <fantasai.lists@inkedblade.net>
CC: "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <EB3E1B49-BF65-4C1D-B977-1B21A9B5F9D1@adobe.com>

On Apr 1, 2013, at 7:17 PM, fantasai <fantasai.lists@inkedblade.net> wrote:

> Mask element can't be used in layers. Are they still affected by the
> mask-position/mask-repeat/etc. properties? If so, why can't they be
> layered? If not, they shouldn't be part of mask-image, but rather
> something else, e.g. mask-element.

The <mask> referencing needs to have the 'mask' property as shorthand. This is a requirement from SVG 1.1 where the original 'mask' property was specified.

We thought about the possibility to specify a new longhand property just for SVG masks. At this time it was because of a mother reason: We tried to solve the problem of resource to image identification just by the URI. We realized that this problem can not be solved with a separate property. make-image and mask-element would both have a URI. How do you differ between the both on a shorthand property? We found another solution to differ between a resource and an image at parse time.

In general, for SVG Mask references the other properties (mask-clip, mask-position, ) are ignored. But the shorthand, as far as I understood, still needs to deal with all longhand values.

> I'm having trouble understanding how the various properties/elements/
> definitions relate, so I have a suggestion based on my somewhat
> incomplete understanding of what's going on:
>   1. Flatten the definition of <mask-image> so there's less
>      cross-referencing between mask-box-image and mask-image.

I started with this. There is no cross referencing between 'mask', 'mask-box-image' and 'clip-path' anymore. Every property set is separated logically of each other.

>   2. Change the title of "Mask" to "Layered Masks" and
>      "Mask Box Image" to "Box-Image Masks" (for parallelism).

That should be possible. SVG masks do not have multiple layers, but can still be seen as a one layer mask.

>   3. Give mask elements and the ways of referencing them their
>      own section, as this seems to be essentially a third feature.

The elements could get an own section. I can not estimate if that makes it more understandable. 'mask-image' would still need to describe the element referencing. Same for 'clip-path' property and <clipPath> element. If people have a strong opinion I will move the elements into a new section. Otherwise I would like to keep them where they are for a better overview.

> On a possibly related topic, what's the difference between mask-type
> and mask-source-type, and why are they two separate properties?

'mask-image', 'mask-source-type' are defined on the element that gets masked while 'mask-type' is defined on the SVG mask element itself. The idea is the following.

The SVG Mask might know best if it contains a luminance mask or alpha mask. Therefore, you can set the mask type on the mask element. But authors are still able to override the mask type value with 'mask-source-type' on a per use cases basis. There are actually use cases where it can make sense and can produce different results.

On image values this allows to use JPEGs as mask source as well, which is not possible with simple alpha masking. (JPEGs do not have an alpha channel and would mask the whole rectangle of the image).

> I'm pondering if 'mask: none' should reset all the mask-* properties.
> I think this would be a good idea, if it can be worked out.

'mask' should not behave any different than 'background' here.


> ~fantasai
Received on Thursday, 4 April 2013 04:09:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 22 June 2015 03:33:49 UTC