Re: CSS Masking

On Thu, Aug 16, 2012 at 3:56 AM, Dirk Schulze <dschulze@adobe.com> wrote:

> To your concerns: If you search for '-webkit-mask-box-image' (a property
> where I thought that it is to specific), you'll find 400,000 search entries
> at Google.


Yeah, -webkit-mask-box-image looks used.

What about mask-attachment:fixed/local? I'm having trouble thinking of a
use for it. Webkit doesn't even implement it (
https://bugs.webkit.org/show_bug.cgi?id=67137). (However, Google claims
100K hits for 'webkit-mask-attachment', so I think we can't quite rely on
those numbers :-).)

Looking at the top 50 Google hits or so I don't see any sign of people
using -webkit-mask-origin or -webkit-mask-clip either.

OTOH -webkit-mask-position, -webkit-mask-size, -webkit-mask-repeat are all
used.

The last thing is the expectation of web authors. We have '-webkit-mask'
> properties for quite some time. They are used for mobile applications and
> websites for WebKit based browsers. You could use SVG mask as fallback, but
> not a lot of web-authors really do. If we redefine the 'mask' properties we
> would not match the expectation of web-authors.
> It is also easier for implementors since the same parsing code from
> background and border-image can be reused for masking. Even the actual
> implementation is really easy since you can again reuse a lot of code. This
> makes it more likely that all browsers can implement this feature.
>

I think you misunderstood the thinking behind my questions :-). I
appreciate the need to be compatible with existing Webkit-prefixed content,
which means we're stuck with having 'mask' be background-like whether or
not that's a good idea. I'm just wondering whether importing every single
feature of CSS backgrounds is necessary or a good idea.

I think the case for dropping mask-attachment is pretty strong, given
Webkit doesn't implement it, no-one has presented any use-cases, and
background-attachment:fixed is a real pain so mask-attachment:fixed
probably would be too.

I think we could also drop mask-origin and mask-clip. OTOH they're not very
hard to implement so you could argue we should just keep them for increased
consistency with backgrounds. I tend to favour parsimony, so dropping them
unless/until there are use-cases, but I wouldn't object to keeping them.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Thursday, 16 August 2012 00:06:00 UTC