In the introduction section of [css-display-3], the "text run" concept is introduced in the following paragraph:
...each _contiguous sequence of sibling text nodes_ generates a _text run_ containing their text contents, which is assigned the same styles as the generating text nodes.
As far as I understand, several contiguous sibling text nodes in the same element can occur only as a result of DOM operations like appendChild()
. But what about sibling text nodes separated only by the HTML comment node? Technically, they hardly can be called "a _contiguous_ sequence", but the intent of the "text run" concept seems to suggest that they should form a single text run rather than two separate ones. Doesn't this need clarifying?
My understanding is that comment nodes exist in the DOM tree but not in the element tree.
The element tree only contains text nodes and elements (including pseudo-elements).
So in your example, the text nodes are actually contiguous.
But of course this needs to be properly defined, see #1810
My understanding was that the element tree is an abstraction and DOM is one its possible implementation (not the only, but the most practically common), so I didn't think of it as of some intermediate structure. This comment from @fantasai seems to support this understanding. So making this definition unambiguous would be really appreciated!
I think it's reasonable to clarify that nodes other than element or text are ignored for the purpose of this definition, yeah.
Most helpful comment
I think it's reasonable to clarify that nodes other than element or text are ignored for the purpose of this definition, yeah.