W3C home > Mailing lists > Public > www-style@w3.org > January 2008

RE: [CSS3 Text] shadow stacking levels

From: Alan Gresley <alan1@azzurum.com>
Date: Wed, 23 Jan 2008 10:49:15 -0700
To: fantasai <fantasai.lists@inkedblade.net>
cc: www-style@w3.org, "L. David Baron" <dbaron@dbaron.org>, David Hyatt <hyatt@apple.com>
Message-ID: <20080123104914.34b83c2f3c9bef00757a2c62c0fb7450.b5a2644a6c.wbe@email.secureserver.net>

fantasai wrote:

> > <span>Hello</span><span style="margin-left:-20px;">world</span>
> > 
> > In the above example, if I put a text-shadow on the span with the 
> > negative margin, the shadow is going to overlap the text in the previous 
> > adjacent span, since the text already overlaps.
> > 
> > Even ignoring this issue, like I said before, in our implementation the 
> > shadow draws at the same time as the text.  It is a byproduct of the 
> > text drawing operation.  Even without the negative margin, an offset 
> > could be specified that has the shadow of the second span drawing on top 
> > of the text in the first span.
> 
> Yes, that second effect is something I think UAs should be encouraged to
> avoid. Putting an invisible element boundary in the text shouldn't cause
> the shadow to, for no visually apparent reason, stack over preceding text.
> I understand that doesn't work nicely in your implementation; that's fine,
> that's why it's a should and not a must.
> 
> ~fantasai


The 'visually apparent reason' for drawing a shadow that way is that that's what a shadow does. A tree will cast it shadow over the grass below. So elements later in the source will cast a shadow over elements earlier in the source.  So depending on the source order, shadows can behave as just described or only cast a shadow under itself. A use case is a well known layout with two floats one with a negative margin.

http://css-class.com/test/css/drop-shadows/drop-shadow-over-element.htm


Please view in Safari. If the blue float doesn't cast it shadow over the pale yellow float, how am I to draw that shadow? I hope not with background images.


Alan

http://css-class.com/
Received on Wednesday, 23 January 2008 17:49:31 GMT

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