Description
In Run-In Layout, CSS Display says
If a run-in sequence is immediately followed by a block box that does not establish a new block formatting context, it is inserted as direct children of the block box after its
::marker
pseudo-element’s boxes (if any), but preceding any other boxes generated by the contents of the block (including the box generated by the::before
pseudo-element, if any).The reparented content is then formatted as if originally parented there. Note that only layout is affected, not inheritance, because property inheritance for non-anonymous boxes is based only on the element tree.
First, does "boxes generated by the contents of the block" include block's ::first-line
? If yes, what about ::first-line
s generated by ancestor blocks?
Second, the premise in the last sentence is false. A non-anonymous box fragment can inherit some properties from a ::first-line
pseudo-element, which is based on the box tree. So it's not clear whether a run-in inserted into the next block is supposed to ignore that block's ::first-line
styles or not.
Example:
<section>
<span>Foo</span>
<div>Bar</div>
</section>
section { color: red }
div::first-line { color: green; background: blue }
span { display: run-in }
What color does Foo have? Does it have a blue background behind?