You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-display] Interaction of run-in and block inside inline #1472
<span>
A
<bstyle="display: run-in">B</b><div>C</div>
D
</span>
I guess it's one of these options:
Option 1
Option 2
The block breaks the inline
<anonymous-block><span>
A
<bstyle="display: run-in">B</b></span></anonymous-block><div>C</div><anonymous-block><span>D</span></anonymous-block>
The run-in generates an anonymous block wrapper
<anonymous-block><span>
A
<anonymous-block><bstyle="display: run-in">B</b></anonymous-block></span></anonymous-block><div>C</div><anonymous-block><span>D</span></anonymous-block>
The anonymous block generated by the run-in breaks the inline
I believe that, first of all, A and D themselves are wrapped in anonymous block boxes, since the container has at least one block box inside, so they all are in the block formatting context. Given that run-in is inserted inside the next block box, I suppose that Option 2, variant 1 is the closest to the answer:
<span>
<anonymous-block>A</anonymous-block>
<div>
<b style="display: run-in">B</b>
C
</div>
<anonymous-block>D</anonymous-block>
</span>
I don't think it's "splitting the span", because in DOM terms both div and run-in box are still nested in the span. But I'm not sure if my understanding is correct from the implementers' point of view.
@SelenIT You are right I forgot to wrap the inline fragments inside anonymous block boxes, I have edited it.
When I said that the block splits the span I meant this:
When an inline box contains an in-flow block-level box, the inline box (and its inline ancestors within the same line box) are broken around the block-level box (and any block-level siblings that are consecutive or separated only by collapsible whitespace and/or out-of-flow elements), splitting the inline box into two boxes (even if either side is empty), one on each side of the block-level box(es).
This does not affect the DOM, of course. I only tried to represent the various box fragments. It's not clear how this affects the box tree, though, so I filed #1477.
@Loirooriol I agree with your correction. Yes, the span box should be fragmented this way. Now I think that Option 2, variant 2 is exactly what should happen here.
We wanted to include the full scope of flow layout anonymous box fixup there, so linked up to 9.2.
(The section in between those headings is relatively short and is a good introduction for understanding 9.2.1.1, so it's not a bad place to land anyway.)
Activity
SelenIT commentedon May 29, 2017
I believe that, first of all, A and D themselves are wrapped in anonymous block boxes, since the container has at least one block box inside, so they all are in the block formatting context. Given that
run-inis inserted inside the next block box, I suppose that Option 2, variant 1 is the closest to the answer:I don't think it's "splitting the
span", because in DOM terms bothdivandrun-inbox are still nested in thespan. But I'm not sure if my understanding is correct from the implementers' point of view.Loirooriol commentedon May 29, 2017
@SelenIT You are right I forgot to wrap the inline fragments inside anonymous block boxes, I have edited it.
When I said that the block splits the span I meant this:
This does not affect the DOM, of course. I only tried to represent the various box fragments. It's not clear how this affects the box tree, though, so I filed #1477.
SelenIT commentedon May 30, 2017
@Loirooriol I agree with your correction. Yes, the
spanbox should be fragmented this way. Now I think that Option 2, variant 2 is exactly what should happen here.fantasai commentedon Jul 5, 2017
@tabatkins and I agree that this is the most sensible option. Should be fixed in 6f6913e.
Let us know if it needs further clarification.
Loirooriol commentedon Jul 15, 2017
It's OK, thanks. But maybe I would restrict to CSS2§9.2.1.1, because CSS2§9.2 is so big.
fantasai commentedon Jul 18, 2017
We wanted to include the full scope of flow layout anonymous box fixup there, so linked up to 9.2.
(The section in between those headings is relatively short and is a good introduction for understanding 9.2.1.1, so it's not a bad place to land anyway.)