Re: Implementation of Inset Box Shadow on image elements

On Jul 27, 2010, at 12:35 PM, fantasai wrote:

> Brian Manthos wrote:
>> 
>> That's a pretty fundamental change.
> 
> So was Brad's proposal to alter border-image, but we took it
> because it was a really good idea.
> 
> Note that while the rest of the features in the module have gone
> to CR, 'box-shadow' is in its first Last Call for Comments phase.
> It is an appropriate time for Divya to be bringing this up.
> 
>> Unless I'm misremembering, this would be the first instance of
>> "render on top of content" for the any of the terms in the module
>> {border, background, border-image, box-shadow}.
>> 
>> Do you really want to open up that can of worms *now*?
> 
> I'm thinking we might.

This worries me, but let's see where it takes us.

> 
>> - how does z-index come into play?
> 
> As I mentioned, it should be painted immediately below z-index: 1,
> so that authors can pop things out of the shadow with 'z-index'.

z-index only applies to positioned elements, so the author will have to
apply both position: and z-index: to pop children above the inset shadow.
That's unfortunate. It also means that a z-index: 0 child that projects outside
the shadowed box's bounds will get the shadow rendered over part of it, which is
weird, unless you also require overflow:hidden here.
Testcase at <http://smfr.org/misc/inset-shadow.html>.

Also, a common use of inset shadows is as an alternative border around
<div>s containing text. It seems wrong for the shadow to cause the text
to "dim out" without further author tweaking.

I'd like to see what changes would be required to <http://www.w3.org/TR/CSS2/zindex.html>
to describe the proposed rendering of inset shadows.

> 
>> - do we need to create a new stacking context?
> 
> No.

I think you should if you propose that z-index >=1 forces child elements to render in front of the shadow.

If the element with an inset shadow is not itself a stacking context, then it vastly complicates the stacking
algorithm. If we are going to have this weird dependency on z-index, then I'd argue strongly that
it should also create stacking context, like opacity does.

Simon

Received on Tuesday, 27 July 2010 21:11:19 UTC