Re: [css-masking] 'mask: none' clear all masking operations

On Sun, Jun 9, 2013 at 1:09 PM, Dirk Schulze <dschulze@adobe.com> wrote:
> On Jun 9, 2013, at 1:04 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>> On Sat, Jun 8, 2013 at 7:34 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>>> Hi,
>>>
>>> I had a chance to discuss this topic with fantasai during the CSS F2F. fantasai suggested that the 'mask-*' properties get a new shorthand property (maybe 'mask-layer'?). 'mask' itself would reset the 'mask-layer' and 'mask-box-image' properties and would itself have a reasonable setting.
>>>
>>> Based on this idea, a syntax proposal could look like this:
>>>
>>> 'mask' = none | <url> [alpha | luminance]?
>>>
>>> - 'none' is the initial value in current implementations
>>> - If 'mask' is set all mask properties (including 'mask-box-image-*' and 'mask-*') are reset to the initial value.
>>> - '<url>' can just be used to reference <mask> elements, as it is defined SVG 1.1 and implemented in all browsers.
>>> - 'mask' will not be a shorthand
>>>
>>> The old 'mask' shorthand will be renamed to 'mask-layer' and all 'mask-*' longhands to 'mask-layer-*' (or a better name if there is one).
>>> - 'mask-layer-image's '<url>' will just support CSS Images, no references to <mask> elements possible.
>>
>> I'm not entirely sure I understand.  'mask' isn't a shorthand?  What
>> exactly does it do, then?  Is it just like 'mask-layer', but with a
>> different value space for <url>, and only supporting one layer?
>
> No layer at all. It is just the normal SVG Masking from SVG 1.1. But with setting the value to none, it resets all masks.(Including CSS Masking from WebKit.) This is similar to border, which resets all settings on border-image.

But "none" is the initial value.  If 'mask' isn't a shorthand, then
it's *always* none by default, which under your described semantics
would prevent any of the other mask-* properties from working.

You can't get the shorthand behavior where it only has the reset
effect if *specified* unless it's actually a shorthand.  Otherwise,
you have to rely on computed-value-time transformations, which always
apply.

~TJ

Received on Sunday, 9 June 2013 18:26:42 UTC