Skip to content

[css-display] Becoming a formatting context without display types #1563

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

Closed
Loirooriol opened this issue Jun 25, 2017 · 7 comments
Closed

[css-display] Becoming a formatting context without display types #1563

Loirooriol opened this issue Jun 25, 2017 · 7 comments

Comments

@Loirooriol
Copy link
Contributor

Becoming a formatting context is defined as follows:

If the element already establishes a formatting context of any kind, this condition is satisfied. Otherwise, it is made to establish a BFC by changing its inner display type to flow-root.

But what happens if an element that does not have inner nor outer display types (i.e. it has display: none or display: contents) becomes a formatting context? Such an element won't establish a formatting context, so its inner display type should be changed to flow-root, but it doesn't have an inner display type!

I think "this condition is satisfied" should also apply in that case.

@SelenIT
Copy link
Collaborator

SelenIT commented Jun 26, 2017

I suppose that becoming a formatting context implies creating a box. Maybe it's better to add a Note to the definition of these display values that they never establish a formatting context?

But it's an interesting case what happens if an element with display:contents gets contain:layout or some other property that usually causes an element to establish a FC. Should that property be ignored at all, should it apply to anonymous wrapper box, or something else should happen?

@frivoal
Copy link
Collaborator

frivoal commented Jun 26, 2017

https://drafts.csswg.org/css-contain/#containment-layout :

If the element does not generate a principal box (as is the case with display: contents or display: none) [...] layout containment has no effect.

In other word, "becoming a formatting context" is not invoked by the contain property on display: contents elements. So from the point of view of that spec at least, it does not matter what the definition of "becoming a formatting context" is for that case.

@Loirooriol
Copy link
Contributor Author

And the same for column-span, which only applies to in-flow block-level elements.

But the definition of "becoming a formatting context" should not rely on not being invoked with display: none or display: contents.

@tabatkins tabatkins added the css-display-3 Current Work label Jun 26, 2017
@frivoal
Copy link
Collaborator

frivoal commented Jun 27, 2017

Sure. I am just saying that form the point of view of these specs, it doesn't matter what we define it to be.

@tabatkins
Copy link
Member

Boxes generate formatting contexts, not elements. I've at least patched that section of the "becoming a formatting context" definition.

The question is thus moot - none or contents prevents the element from generating a box at all, so there's no box to create a formatting context in the first place.

@Loirooriol
Copy link
Contributor Author

Well, before 71cfe56, it were elements what could "become a formatting context". Changing it to boxes fixes this issue, but now "becoming a formatting context" is not well-defined, because boxes don't have display types (#1480). If you plan "become a formatting context" to affect computed display, it needs to happen on the element, otherwise there could be no display value which generates the resulting boxes.

@tabatkins
Copy link
Member

Yes, the section as a whole needs to be rewritten - it's currently marked for discussion at the F2F next month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants