Re: [csswg-drafts] [css-display] How does block inside inline affect the box tree, exactly?

I forgot that #1617 was a requirement. With the resolution above,

```html
<main><span>A<div>B</div>C</span></main>
```

produces this box tree:

```
main: block box, IFC root
  └ span: inline box
      └ div: block box
```

(`<main>` establishes an IFC because it only contains inline-level children.)

Then the fragment tree is

```
fragment of main
  └ line box
      └ first fragment of span
  └ fragment of div
  └ line box
      └ last fragment of span
```

But this is wrong, a fragment of a box which establishes an IFC should only contain line boxes!

So we should say sequences of inline-level content directly contained in an element-generated block container are always wrapped inside an anonymous block container, which is what establishes the IFC. That is, element-generated block containers never establish an IFC.

Then the box tree is

```
main: block box
  └ anonymous: block box, IFC root
      └ span: inline box
          └ div: block box
```

and this way the fragment tree ends up as desired:

```
fragment of main
  └ first fragment of anonymous block
      └ line box
          └ first fragment of span
  └ fragment of div
  └ last fragment of anonymous block
      └ line box
          └ last fragment of span
```


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

Received on Friday, 13 April 2018 14:09:46 UTC