Re: [CSS3 Text] shadow stacking levels

On Jan 23, 2008, at 6:02 PM, fantasai wrote:

>
> I want to see this:
>  <p style="text-shadow: xxx;">Some text</p>
> and this
>  <p style="text-shadow: xxx;">Some <span>text</span></p>
> where the span has no styling applied to it whatsoever, be rendered  
> exactly
> the same. I think that's a reasonable expectation. If the author  
> desires
> some kind of layering effect, he can use position: relative; and z- 
> index to
> make the span move forward in the stacking order. If you can't do it  
> in your
> implementation, that's fine, I'm not proposing to require it. I'm only
> proposing to recommend it.
>
> There are different ways to optimize text rendering, and it's entirely
> plausible that a layout engine will collect together cross-element  
> runs
> of text that share the same styling and send the entire run to the  
> text
> renderer at once. In such a case, the shadows will not overlap as in  
> your
> implementation.

Sure.  That's even an optimization that I expect we will implement  
soon.   This is exactly why I think it's dangerous to over-specify how  
text shadows draw  (box-shadow is at much more predictable, since when  
borders/backgrounds draw is very well-specified).  Because shadows are  
tied to the exact drawing operations you make, you really can't  
guarantee how a browser will render the text shadows in those examples  
if the shadows overlap adjacent text.

I still take issue with the "should" sentence, though, in the case  
where spans are deliberately overlapping (obviously the shadow has no  
reason to avoid drawing over the other span's text in the negative- 
margin case).

dave

Received on Wednesday, 23 January 2008 21:29:49 UTC