As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 581601 - -moz-box-shadow renders box-shadow behind an image element if specified for img
: -moz-box-shadow renders box-shadow behind an image element if specified for img
Product: Core
Classification: Components
Component: Layout: View Rendering (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2010-07-23 16:17 PDT by Divya Manian
Modified: 2010-07-23 19:29 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Divya Manian 2010-07-23 16:17:36 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.466.4 Safari/534.3
Build Identifier: 4.0b3pre

The spec says box-shadow should render on all elements.  The inset shadow seems to render behind the contents of the element, this would be fine for all elements except the image element, where it should render in front of the image to serve any useful purpose. 

You can see this in action on the URL mentioned. The left image does not seem to have any box-shadow, but the right image (which is a transparent version of the left one) has them. 

Also reducing the opacity of the image does not seem to have any effect on getting the box-shadow to show. 

This is a cross-browser issue: Safari/Chrome/Opera/Firefox. 

Reproducible: Always

Steps to Reproduce:
1.Click the URL
Actual Results:  
No box shadow on the image

Expected Results:  
There should be a inset box shadow on the image
Comment 1 User image David Baron :dbaron: ⌚️UTC-8 2010-07-23 16:49:01 PDT
This looks like how things are supposed to work.  Why do you think they should work some other way?
Comment 2 User image Divya Manian 2010-07-23 16:57:32 PDT
I assert that is not how it is supposed to work for image element. 

The spec says:

"The shadow effects are applied front-to-back: the first shadow is on top and the others are layered behind…In terms of stacking contexts and the painting order, the outer shadows of an element are drawn immediately below the background of that element, and the inner shadows of an element are drawn immediately above the background of that element (below the borders and border image, if any)."

My view is the last sentence does not apply completely to an image element, given that typically it does not have a background.
Comment 3 User image David Baron :dbaron: ⌚️UTC-8 2010-07-23 17:18:18 PDT
Image elements can have backgrounds, which you'll see when the image is partly or completely transparent.
Comment 4 User image adam j. sontag 2010-07-23 17:42:54 PDT
Yes, but having an inset shadow on an image's background is simply not the same as the actual image having an inset shadow.
Comment 5 User image Boris Zbarsky [:bz] (still a bit busy) 2010-07-23 19:29:51 PDT
Marking invalid, since this is what the spec in fact says we should do; bringing spec changes up on www-style as you did is the right thing.  If the discussion there leads to a spec change, please reopen.

Note You need to log in before you can comment on or make changes to this bug.