Bug 1834403 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

https://www.w3.org/TR/CSS22/visuren.html#propdef-z-index defines `z-index: auto` with

> If the box `has position: fixed` or if it **is the root**, it also establishes a new stacking context.

https://drafts.csswg.org/css-position/#stacking

> The root element always forms a stacking context regardless.

Blink and WebKit are correct, the root element always establishes a stacking context.

But Firefox doesn't establish a stacking context for `z-index: auto` with `position: relative` or `position: absolute`.
https://www.w3.org/TR/CSS22/visuren.html#propdef-z-index defines `z-index: auto` with

> If the box has `position: fixed` or if it **is the root**, it also establishes a new stacking context.

https://drafts.csswg.org/css-position/#stacking

> The root element always forms a stacking context regardless.

Blink and WebKit are correct, the root element always establishes a stacking context.

But Firefox doesn't establish a stacking context for `z-index: auto` with `position: relative` or `position: absolute`.

Back to Bug 1834403 Comment 0