[css-display] Can run-in be inserted as child of block which establishes an inline formatting context? (original) (raw)
CSS Display defines Run-In Layout as
A run-in box behaves exactly as an inline-level box, except:
- If a run-in sequence is immediately followed by a block box that does not establish a new formatting context, it is inserted as direct children of the block box [...]
- Otherwise, an anonymous block box is generated around the run-in sequence and all immediately following inline-level content (up to, but not including, the next run-in sequence, if any).
- A run-in box with a flow inner display type inlinifies its contents.
The following example is provided:
- dictionary
- a book that lists the words of a language in alphabetical order and gives their meaning, or that gives the equivalent words in a different language.
- glossary
- an alphabetical list of terms or words found in or relating to a specific subject, text, or dialect, with explanations; a brief dictionary.
.dict > dt { display: run-in; } .dict > dt::after { content: ": " }
Which is formatted as:
dictionary: a book that lists the words of a language in alphabetical order and explains their meaning.
glossary: an alphabetical list of terms or words found in or relating to a specific subject, text, or dialect, with explanations; a brief dictionary.
However, the dd establishes an inline formatting context according to CSS 2.1:
A block container box either contains only block-level boxes or establishes an inline formatting context and thus contains only inline-level boxes.
So I think that either the example is wrong and the dt should not be inserted inside the dd, or that the definition should allow a run-in sequence to be inserted as direct children of a block box which establishes an inline formatting context.