W3C home > Mailing lists > Public > www-style@w3.org > December 2007

Re: [css3-background] CSS Drop Shadows

From: David Hyatt <hyatt@apple.com>
Date: Wed, 19 Dec 2007 12:07:15 -0600
To: Brad Kemper <brkemper@comcast.net>
Cc: John Oyler <johnoyler.css@gmail.com>, www-style@w3.org, fantasai <fantasai.lists@inkedblade.net>
Message-id: <B3373751-B1E0-46C9-8371-2704D61600A3@apple.com>

On Dec 19, 2007, at 9:54 AM, Brad Kemper wrote:

> Well, I guess that is the big question. Personally, I think most of  
> the time I wouldn't mind having the show continue fully under the  
> box, but it might be useful at times to turn that off, perhaps with  
> an extra parameter to box-shadow to say if that it is knockout  
> (defaulting to "not").
>

We can't implement the other way.   Shadows in CoreGraphics are drawn  
as a side effect of another drawing operation.  You "turn on" shadows  
in the graphics context, do some drawing, and a shadow is cast by  
whatever you draw automatically.  This means that in order to  
implement box-shadow, we actually have to do a fill rect operation.   
The only way to show only the shadow and not the fill is to set a clip  
that prevents the area occupied by the fill from being drawn into.

For a fully transparent box, there is no shadow to be cast, since  
there is no fill, and the shadow is inside the area occupied by any  
fill that we would do in order to get the shadow to draw in the first  
place.

> It is interesting to note that when combining text-shadow with  
> opacity that the shadow does not show through the letters. It does  
> seem as though there should be some consistency between the text- 
> shadow and box-shadow.
>

It's not supposed to.  opacity blends everything inside the layer  
after the fact as a single unit. so I think this is not a very good  
example to bring up.

If you did RGBA text with text-shadow, then you would see the shadow  
behind the letters.

dave
(hyatt@apple.com)
Received on Wednesday, 19 December 2007 18:07:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:57 GMT