Re: Concern about -webkit-mask

On Wed, Apr 18, 2012 at 3:46 PM, Dirk Schulze <dschulze@adobe.com> wrote:

>
> On Apr 18, 2012, at 12:34 PM, Rik Cabanier wrote:
>
> > -webkit-mask-image is identical to SVG's definition of mask: convert RGB
> to luminance and multiply with the alpha.
> > Looking at all the keywords to support this property [1], it seems that
> more is needed to control the mask than just referring to a URI.
> No, it is not similar. -webkit-mask-image is just compositing without the
> intermediate step of luminance.
>
>
You are correct. '-webkit-mask-image' just does a PorterDuff 'src-in' with
the specified image and the element.
It acts like a background along with all the background keywords except it
is composited last.

I think we should create a new keyword that lets you point to an SVG or an
image file to use as a mask (just like -webkit-mask-image) except you can
also specify if you want a hard clip, a luminosity mask or an alpha mask.
It would be really nice if we could come up with a way to reuse
'background-image' but I'm unsure how to do that cleanly.

Rik


>
> >
> > Rik
> >
> > [1]:  http://www.webkit.org/blog/181/css-masks/
> >
> > On Tue, Apr 17, 2012 at 10:50 PM, Robert O'Callahan <
> robert@ocallahan.org> wrote:
> > SVG 'mask' should 'just work' on HTML, the same way we've defined SVG
> 'filter' to 'just work' on HTML. SVG masks have the unfortunate properties
> that they require an external mask element and they use luminance instead
> of alpha to define the mask operation, so I think something like
> -webkit-mask is also useful. Someone should look at the ways people are
> using -webkit-mask, then ideally we can extend SVG 'mask' with enough of
> the -webkit-mask syntax to cover that usage (and for that syntax, mask
> using alpha instead of luminance); if not I guess we'll have to define a
> new property with the functionality of -webkit-mask.
> >
> > 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 Wednesday, 18 April 2012 23:27:07 UTC