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

Re: [css3-background] error in box-shadow examples?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 26 Jan 2009 10:44:58 -0800
Message-ID: <497E04AA.1020708@terrainformatica.com>
To: Håkon Wium Lie <howcome@opera.com>
CC: Brad Kemper <brad.kemper@gmail.com>, www-style@w3.org
Håkon Wium Lie wrote:
> Also sprach Brad Kemper:
While we are on this page I'd like to mention that definition of drawing 
here http://dev.w3.org/csswg/css3-background/#box-shadow is not correct.
At least for practical use cases.

Please see attached image. Markup there is
  <div class="with-shadow">First</div>

Shadowed elements shall be drawn on a separate layer to achieve 
rendering as on the image.
That is pretty much the same layer that 'outline' uses (that is why I 
proposed to make
shadows as just special type of outline).

Algorithm is close to this:

1) Draw all elements that have no shadow set.
2) Draw shadow for elements with shadow on top of normal elements.
3) Draw shapes of shadowed elements (but not their shadow).

By their nature elements with shadows have "z-index" higher than other 

There are also special cases that needs to be mentioned:
a) Scrollables clip shadow of their children.
b) Shadows of positioned elements (relative, absolute, fixed) use also 
algorithm above
but on their own layer.

Andrew Fedoniouk.

(image/png attachment: shadow.png)

Received on Monday, 26 January 2009 18:45:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:23 UTC