[css-masking] first proposal

Hi CSS folks,

I created a first proposal for the CSS Masking specification [1]. I specified the current behavior of the '-webkit-mask' properties and integrated the latest draft of SVG Masking from SVG 2. The text complies to CSS Background and Borders and should be very familiar for many people. Please take the time for a review. I am happy to address concerns and reply to questions.

Note that this mail was send to the public-fx mailing list first. I send it to www-style to reach out to a bigger audience for more feedback. Therefore I attached the first review and the comments at the end of this mail as well.

Thanks for your attention!
Dirk

[1] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html

On Aug 12, 2012, at 4:57 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> Hi Dirk,
> 
> thanks for starting this!
Hi Rik,

Thanks a lot for taking the time to read the draft!

> I have a couple of remarks:
> 1. Layering multiple mask images [1].
> I'm unsure if this is needed. How many times do you want different masks apply at the same time?
I agree that most developers will create one image mask instead of sending multiple images. However, since we are no only talking about rasterized images, but also new functionalities like linear-gradients, radial-gradients and the element() function. And also on images, you could use different images with different sizes and combine them with one of the other mask properties to have cool results. So I hope that this can be very useful in general.

> Is this so you're compatible with background-image?
> We would need to change the model for this too.
Yes and no. In the first place it is to be compatible with background, but it also has good use cases in general.

> How is the actual mask calculated? do you combine the images first into an image and then use that as as a mask?
The spec says "The first image in the list is the layer closest to the user, the next one is painted behind the first, and so on. All mask images are combined by compositing on the mask." A mask is defined as transparent black offscreen buffer. So yes, they get combined to one image.


> 
> 2. 'The first image in the list is the layer closest to the user, the next one is painted behind the first, and so on. '
> Not sure this sentence makes sense.
This is copied from CSS3 Backgrounds and borders for compatibility reasons.

> 
> 3. linear vs sRGB colorspace [2].
> We should follow the example of filters and keep sRGB as the colorspace. linearRGB can be an option but I'd prefer to see it replaced with real color management.
> It is also much faster.
We use sRGB and linearRGB is just an option. Not sure what you are referring to.

> 
> 4. the mask-clip property [3]
> What does it mean when the mask is clipped? Will the output be removed (since it is outside of the mask), or is the output unaffected?
The actual mask image gets clipped before drawing onto the mask.

> 
> 5. the mask-type property [4]
> You know that I think it should always be luminance :-)
> More intuitive to use (for designers). It also allows you to use jpeg images as a mask.
It depends on the use case, yes. Like discussed before, there is an issue that refers to your point. I would rather wait for more input from authors before changing the default value. Note that it might not even be an option for WebKit since there is content out there using -webkit-mask with alpha masking already.

> 
> 6. the 'mask' property [5]
> - you still have 'select'. I believe Brian proposed a different word.
No, that was his last proposal since the use case of select() differs from element().

> - since you can have both 'mask' and 'mask-image', we need to specify which one wins or if they're applied at the same time.
This is already specified. The shorthand overrides the single properties.

> -  it would be good if we can combine it with mask-image somehow
I thought about it as well. The problem that I see is that 'mask' elements already specify clipping region, mask region and the affected regions. It would lead to a lot of confusion if the properties and the element can influence the values in different ways.

> 
> Maybe you should send this to www-style too!
Feedback for FXTF specifications should go to public-fx mailing list. However, you are right that a lot more people seem to follow www-style. So I forward this mail to www-style as well and change the subject.

Again, thanks a lot for your feedback!

Greetings,
Dirk


> 
> Thanks!
>    Rik
> 
> 1: http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#layering 
> 2: http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#MaskValues
> 3: http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#the-mask-clip 
> 4: http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#the-mask-clip
> 5:  http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#mask-property 
> 
> On Sat, Aug 11, 2012 at 10:47 PM, Dirk Schulze <dschulze@adobe.com> wrote:
> Hi FXTF,
> 
> I created and published the CSS Masking specification [1]. I specified the current behavior of the '-webkit-mask' properties and integrated SVG Masking from SVG 2. The text complies to CSS Background and Borders and should be very familiar for many people. I would like to receive some comments even if it is still in an early stage.
> 
> Greetings,
> Dirk
> 
> [1] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html
> 

Received on Monday, 13 August 2012 01:54:06 UTC