-
Notifications
You must be signed in to change notification settings - Fork 715
[css-contain] Clarify what happens when display: contents
and contain: style
are used together
#7392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FWIW I think I think this should probably not work:
|
Yeah, I don't think the difference in wording was intentional here, it was just that the definition of the other containments is much more dependent on a box existing so we called out the effects. I'm happy to say that no containment has an effect if you don't have a principal box. |
Could we get the spec updated to reflect this? CC @frivoal; maybe this needs to be on the CSSWG agenda? Assuming we're in agreement, we need to update at least one WPT since the expectations have changed: Right now that test has the following note in an assert meta-tag (emphasis added by me):
If we change the spec as discussed above, then the test should be updated to expect that contain:style has no effect. |
[Ticking agenda+; I'm assuming this needs csswg discussion/resolution to move forward.] |
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> emilio: things like counters don't usually have an effect on things without boxes<TabAtkins> emilio: it would be tricky/weird to have contain:style have an effect on display:contents elements <TabAtkins> emilio: I think Tab agrees with this <fantasai> TabAtkins: Agree this is fine. Just need to copy language over, and maybe generalize so that style containment doesn't apply to things without a box <TabAtkins> astearns: concerns? <TabAtkins> astearns: proposed resolution is to specify that style containment has no effect on elements without a principal box <TabAtkins> TabAtkins: I think I'll just say that *no* containments work, but yeah <TabAtkins> RESOLVED: No containments apply to elements that don't generate a principal box |
Fixed in 1340485 |
Regarding https://drafts.csswg.org/css-contain/#containment-style:
The other types of containment have language like this:
This means these types of containment have no affect when
display: contents
is used. In the case ofcontain: style
this text isn't there. Should elements that havecontain: style
anddisplay: contents
establish a new style boundary? It seems that in Chrome it does, though perhaps with some bugs. In Gecko, this behavior might be a bit trickier to implement.The text was updated successfully, but these errors were encountered: