[css-display] Do empty text nodes generate text runs? · Issue #1808 · w3c/csswg-drafts (original) (raw)

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/

Foo

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.