Open fantasai opened 4 years ago
CSS2 seems to assume that stacking contexts can only be established by positioned elements with non-auto
z-index
(and the root element).
But now we have plenty of ways for that. Like the transform
and opacity
listed above, but also will-change
, contain
, isolation
, filter
, perspective
, etc. The new text should not make assumptions about how the stacking context was established, since other specs can introduce new ways of establishing it.
It should specify the resolution of #2717.
Also, I'd probably name the spec "CSS Painting Model" or something along those lines. And it definitely needs to define terms for the various things that can happen (mentioned in the previous 2 comments) that other specs can hook into.
z-index
is now the only CSS property that is not defined anywhere outside of the CSS2 spec, so I think creating a spec for it (or merging it into an existing one) would be a big step forward in making the CSS2 specification obsolete.
Painting order and stacking contexts are now in https://drafts.csswg.org/css-position-4/#painting-order, so I guess z-index
could be there too.
Oh yeah it should definitely live in Position.
For now I think that's fine, though in the long term I think we should really have a CSS painting model spec (as discussed at least once in the past).
I just edited the initial comment to include the other things that have been raised here, and in that other linked discussion. (The list more than doubled in length, I think.)
Filing this issue to track that we need a stacking/painting order spec. Topics should include (note this list has been edited substantially since the issue was initially filed):
(Feel free to edit this description to add more tracking items, or comment below and I'll edit if you don't have permissions.)