Elements with opacity are mixed with absolute positioned elements

RESOLVED DUPLICATE of bug 401682

Status

()

RESOLVED DUPLICATE of bug 401682
11 years ago
9 years ago

People

(Reporter: jepsar, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5

Elements with opacity are mixed with absolute positioned elements See testcase.

Reproducible: Always

Steps to Reproduce:
See testcase.
Actual Results:  
div#opacity is mixed with div#absolute.

Expected Results:  
div#absolute should be completely gray
(Reporter)

Comment 1

11 years ago
Created attachment 315256 [details]
Testcase

Comment 2

11 years ago
Looks the same in Safari on Tiger, fwiw.

Comment 3

11 years ago
Test case works correctly. The two elements have the same stacking level.

Opacity establishes a stacking context and affects z-ordering, the same way as position:absolute (or relative) does.
From CSS 2.1:
http://www.w3.org/TR/CSS21/visuren.html#z-index
"Stacking contexts are not necessarily related to containing blocks. In 
future levels of CSS, other properties may introduce stacking contexts, 
for example 'opacity'."

See also this email from D. Baron to the CSS-Discuss mailing list for a pointer:
http://archivist.incutio.com/viewlist/css-discuss/69890
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

11 years ago
(In reply to comment #3)
> Test case works correctly. The two elements have the same stacking level.
> 
> Opacity establishes a stacking context and affects z-ordering, the same way as
> position:absolute (or relative) does.
> From CSS 2.1:
> http://www.w3.org/TR/CSS21/visuren.html#z-index
> "Stacking contexts are not necessarily related to containing blocks. In 
> future levels of CSS, other properties may introduce stacking contexts, 
> for example 'opacity'."
> 
> See also this email from D. Baron to the CSS-Discuss mailing list for a
> pointer:
> http://archivist.incutio.com/viewlist/css-discuss/69890

Thank you. I assumed this was a bug because it worked differently in FF2. You might have a bug in FF2 then ;)
Well, it's actually not clear whether this is a bug given current specs.  'opacity' needs to force a stacking context, but that doesn't mean it needs to interleave with positioned elements rather than non-positioned ones.

I'm presuming this changed when frame display lists landed (although I didn't actually check).  I'm curious whether roc knows if it was intentional...
This is intentional. Whether it's a good idea is debatable :-) but it would require a fairly convincing argument to change it, since we interoperate with Webkit at least.
Resolution: INVALID → DUPLICATE
Duplicate of bug: 401682
You need to log in before you can comment on or make changes to this bug.