Skip to content

[css-display] Do empty text nodes generate text runs? #1808

Closed

Description

Image for: Description

Do text nodes with an empty string value generate a text run or not?

The difference will affect run-in layout:

If a run-in sequence is immediately followed by a block box [...]

And it's also observable in flow layout. According to CSS 2.2,

Line boxes that contain no text [...] must be treated as not existing [...]

I guess "text" refers to text runs. See https://jsfiddle.net/rs94bpay/

<div><div>Foo</div></div>
div {
  white-space: pre;
  border: 1px solid blue;
}
document.querySelector('div').prepend('');

Firefox does not discard the line because of the text node, Chrome and Edge do.

Metadata

Image for: Metadata

Metadata

Image for: 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

    Image for: Issue actions