Re: mask-type property

To get back to this discussion.

I thought about 'mask-type' again, and it just feels cleaner to move 'mask-type' back to the mask shorthand. Furthermore, I would add the value 'auto' (with initial value 'auto') for various reasons:

a) If we keep <mask-source> and <mask-image> together on 'mask-image', then both have different default values for the mask type. 
b) 'auto' seems not to be in conflict with the current short hand syntax:

	<mask-layer> = <mask-image> || <position> [ / <mask-size> ]? || <repeat-style> || <box>{1,2}

and would get:

	<mask-layer> = <mask-image> || <position> || <mask-type> [ / <mask-size> ]? || <repeat-style> || <box>{1,2}

The only other property with the keyword 'auto' is mask-size, which must have a '/'. Therefore we can always differ between the two autos, if CSS parser implementations work in a proper way (did not verify).

We can even keep the property on <mask> element, it would just have a different meaning ('mask' does not apply to <mask> currently).

The mask property would have the following syntax:

	<mask-property> = luminance | alpha | auto

I am just proposing this and would like to get some feedback.

Greetings,
Dirk

On Sep 19, 2012, at 8:50 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> 
> On Sep 20, 2012, at 1:33 AM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
> 
>> On Thu, Sep 20, 2012 at 12:02 AM, Cameron McCormack
> <cam@mcc.id.au> wrote:
>>> We discussed at the F2F this week the 'mask-type'
> property, and we decided
>>> not to allow it to be specified on arbitrary
> elements to affect how a mask
>>> that applies to that element would be
> interpreted.  (Instead, we have
>>> "luminance" and "alpha" keywords in the
> 'mask' property itself.)  Instead we
>>> decided to make 'mask-type' only
> apply to <mask>.  This is in place of the
>>> current maskType="" attribute
> on <mask>.
>>> 
>>> I was just implementing this, and I wondered whether it
> really makes sense
>>> for it to be a property.  I don't think there are
> really any use cases for
>>> using style sheets to change how a <mask>
> element is interpreted.  I think
>>> therefore we should stay with a plain
> attribute on <mask>, but perhaps call
>>> it something other than
> maskType="", just to avoid the camel-casing issues
>>> that Simon brought up.
> I think type="" would work fine.
> We decided to follow presentation
> attributes like 'clip-path'. Therefore there is not camel case and the
> attribute looks like in this example:
> 
> <mask mask-type"alpha">Š
> 
> See webkit
> implementation for real examples [1].
> 
> I don't think that we should
> introduce a normal, new attribute. The CSS property makes a lot more sense
> here IMO.
> 
>> 
>> My justification for it was setting all of the <mask>s in
> your page to
>> be alpha.  Without a property, you have to explicitly add an
> attribute
>> to every one of them.
> That is one fantastic example.
> 
> Dirk
> 
>> 
>> 
> ~TJ
>> 
> 
> [1] http://trac.webkit.org/changeset/129018
> 

Received on Wednesday, 21 November 2012 05:05:18 UTC