New issue
Advanced search Search tips

Issue 913406 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 10
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Contain layout causes a new stacking context breaking z-index

Reported by tuhoojab...@gmail.com, Dec 10

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36

Steps to reproduce the problem:
1. Create 3 elements, two with position relative and a third one as a child of the first one with position absolute
2. Use z-index to make sure the third element is not occluded by the second element
3. Add contain: layout to the first element
4. The third element is now occluded by the second element (as if it had no z-index)

Reproduction: https://jsfiddle.net/7Lfj08qt/1/

What is the expected behavior?
Works in Firefox and older Chrome versions: http://browsershots.org/https://jsfiddle.net/7Lfj08qt/1/embedded/result/

What went wrong?
Seems like contain: layout creates a new stacking context causing the z-index to stop working. 

Did this work before? Yes 70

Does this work in other browsers? Yes

Chrome version: 71.0.3578.80  Channel: stable
OS Version: OS X 10.14.2
Flash Version: -

According to https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context contain: layout is supposed to create a new stacking context so perhaps this is the way it should be based on the spec and other browsers haven't fixed/implemented it yet.
 
I found that it's actually the correct behavior: https://bugs.chromium.org/p/chromium/issues/detail?id=884038#c6
Labels: Needs-Bisect Needs-Triage-M71
Status: WontFix (was: Unconfirmed)
This is indeed the intended behavior. Thanks for the follow up.

Sign in to add a comment