Re: [CSSWG] Minutes and Resolutions 2009-02-04: box-shadow and border-image

David Hyatt wrote:
> 
>>     ..and then clip out the padding-box from that, which ordinarily
>>     would not have a shadow from the border cast onto it (or does this
>>     shadow still get drawn behind the padding box?)...
>>
>>
>> You build the element's mask, then you build the shadow, then you cut 
>> the mask out of the shadow by painting alpha=0 with the "source" 
>> Porter-Duff operator using the element's mask as the mask. The alpha 
>> values of the cut-out shadow will be the shadow alpha value multiplied 
>> by (1 - the mask alpha value). So no shadow will draw under the 
>> padding-box.
> 
> I think Brad's point is that no shadow should appear under the original 
> location of the padding box either.  It's a given that the shadow itself 
> when offset will contain only transparent pixels in its own offset 
> padding area, but the offset "border" portion of the shadow should also 
> not appear behind the original padding box.
> 
> Basically you clip out the original padding box from any drawing you do 
> right up front just as with normal box shadow, and then build/paint the 
> shadow as you suggested.

I think, actually, that you don't want to clip out the padding-box area
if, e.g. the middle part of the image is being used. In the cases where
the border image describes a non-rectangular shape, the padding edge will
not really have a graphical meaning, and you'll need to either fill the
entire internal part of the image with a background pattern or leave it
wholly transparent.

I guess this ties in with the suggestion of being able to control whether
the middle part is used or clipped out, possibly defaulting to clipped out.
   http://lists.w3.org/Archives/Public/www-style/2009Jan/0431.html
   http://dev.w3.org/csswg/css3-background/#the-border-image-property

BTW, Hyatt, on a tangential note.. does Webkit implement this part
   # If the slash is present in the property value, the one to four
   # values after it are used for the width of the border instead of
   # the ‘border-width’ properties (but only if the specified image
   # can be displayed).
and is its effect on layout desired or should it merely be a graphical
thing?

~fantasai

Received on Friday, 13 February 2009 01:23:25 UTC