Skip to content

[css-display][css-flexbox][css-grid] Interaction of 'display: contents' and 'run of text' #1281

Closed
@Loirooriol

Description

@Loirooriol

Various specifications use the term 'run of text'. For example, CSS Flexbox and CSS Grid:

each contiguous run of text that is directly contained inside a flex container is wrapped in an anonymous flex item.

Each contiguous run of text that is directly contained inside a grid container is wrapped in an anonymous grid item.

But as far as I know, this term is not defined anywhere. So I don't know how it should interact with display: contents. For example, https://jsfiddle.net/p63c5uyt/

div {
  display: flex;
  flex-direction: column;
}
span {
  display: contents;
}
<div>Foo<span>Bar</span></div>

Should Bar appear next to or below Foo?

Both Firefox and Chrome consider that display: contents makes both Foo and Bar to be in the same run of text. This is not obvious to me.

Tab wants (#1118 (comment))

to define "text" as an object in the element tree that has properties (only set via inheritance), and which generates "text" in the box tree accordingly

not sure if this has any impact, given that Foo and Bar are different text nodes in the DOM.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions