Re: [csswg-drafts] [css-contain] Is it ok that contain:layout is a CB for fixpos/abspos descendants but doesn't establish a stacking context?

> positioned descendants and descendants which actually create a new stacking context
> 
> Fun fact: up until now, this category has basically been 100% equivalent to the set of all elements that establish a containing block for abs-pos descendants. (Please correct me if I'm wrong, but I'm pretty sure these are 100% equivalent.)

It's not true that containing block, positioning, and stacking context imply each other. Some of the stacking context triggers do not imply containing block for abs pos. Opacity is one example.

However, I think what you might have meant to say is that the set of element which are treated in the special category by the painting algorithm is positioned elements + stacking contexts, and that this is a good invariant to keep in order to avoid code complexity in the engines and reduce developer confusion. This is also what @dbaron proposed resolving in the first bullet of this comment: https://github.com/w3c/csswg-drafts/issues/2717#issue-327531273. I added some notes in the end of that other issue regarding various kinds of replaced content that don't fit this model.

However, I think that making contain:layout a stacking context would be a good change, since I agree
that it would simplify implementations and be less confusing for developers. Let's resolve this, and
I will try to make the change happen in Chromium.

-- 
GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2942#issuecomment-407956323 using your GitHub account

Received on Thursday, 26 July 2018 02:30:20 UTC