Skip to content

[css-display-3] Specify who establishes initial formatting context #6708

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
rosshjb opened this issue Oct 2, 2021 · 5 comments
Closed

[css-display-3] Specify who establishes initial formatting context #6708

rosshjb opened this issue Oct 2, 2021 · 5 comments

Comments

@rosshjb
Copy link

rosshjb commented Oct 2, 2021

According to https://www.w3.org/TR/css-display-3/#block-container:

A block container either contains only inline-level boxes participating in an inline formatting context, or contains only block-level boxes participating in a block formatting context

When we have only divs in body element, does who establishes initial block/inline formatting context? In this case, i didn't apply any properties like display: flow-root explicitly:

<body>
  <div>1</div>
  <div>2</div>
</body>

Certainly, because the body only contains block-level elements, these two divs participate in block formatting context, and thus we can say that the body is block container, at least.

But the condition which in BFCs are established is as follows( from https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#block-formatting ):

Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts for their contents.

The example i posted above doesn't satisfy any these cases. So, i think that the spec should contain who establish initial formatting context.

@Loirooriol
Copy link
Contributor

Yes, that <body> is a block container, and is a block box. But it doesn't establish a BFC, it just continues the BFC established by the <html>. The <html> mush establish its own BFC because there is no parent BFC.

@rosshjb
Copy link
Author

rosshjb commented Oct 7, 2021

@Loirooriol How do we know that the html establish a BFC, from specification? I could find the closest thing to the fact only in the following:

A block container establishes a new block formatting context if its parent formatting context is not a block formatting context[...] — https://www.w3.org/TR/css-display-3/#block-container

But, can we say that establishes a new block formatting context if its parent formatting context is not a block formatting context equals to establishs its own BFC because there is no parent BFC.? In other worlds, "a parent is not BFC" -> "there is no parent"?

It may not matter who establishes the initial FC but i think it's better to specify this concern explicitly.

@Loirooriol
Copy link
Contributor

Yes, it could be more clear. I guess this is basically a duplicate of #6480

@rosshjb
Copy link
Author

rosshjb commented Oct 7, 2021

@Loirooriol So, closing this?

@Loirooriol
Copy link
Contributor

Duplicate of #6480

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

2 participants