[csswg-drafts] [css-position] Does the root element establish a stacking context? (#8353)

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-position] Does the root element establish a stacking context? ==
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.

Similarly, https://drafts.csswg.org/css2/#propdef-z-index says

> The box does not establish a new stacking context unless it is the root element.

But https://drafts.csswg.org/css-position/#stacking doesn't mention anything like that.

[Testcase](https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cstyle%3E%0A%3Aroot%20%7B%20box-shadow%3A%20inset%200%200%200%2050vmax%20orange%3B%20height%3A%20100%25%3B%20%2F*position%3A%20relative%3B*%2F%20%2F*z-index%3A%200*%2F%20%7D%0A%3Aroot%3A%3Abefore%20%7B%20content%3A%20%22Text%22%3B%20position%3A%20relative%3B%20z-index%3A%20-1%20%7D%0A%3C%2Fstyle%3E):

```css
:root { box-shadow: inset 0 0 0 50vmax orange; height: 100%; /*position: relative;*/ /*z-index: 0*/ }
:root::before { content: "Text"; position: relative; z-index: -1 }
```

**Firefox**: the root element establishes a stacking context if not positioned or if `z-index` is not `auto`.
**Blink/WebKit**: the root element always establishes a stacking context.



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8353 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 24 January 2023 13:30:10 UTC