Skip to content

[css-display-3] text run ? #7768

Open
Open

Description

@letochagone

in the second paragraph , https://www.w3.org/TR/css-display-3/#intro
what does the term "text run" mean? :

Each box in the box tree represents its corresponding element (or pseudo-element)
in space and/or time on the canvas, while each TEXT RUN in the box tree likewise represents
the contents of its corresponding text nodes.

after a lot of time trying to translate this term into my language, I think it may be a mistake and that this word "run" was added by mistake.

Activity

  1. myakura commented on Sep 20, 2022

    @myakura
    Contributor

    I don't think that's added by mistake. While it's a different spec, HTML also uses "run" as a noun meaning like a sequence.
    (And that confuses people, too. whatwg/html#6782)

  2. Loirooriol commented on Sep 20, 2022

    @Loirooriol
    Contributor

    Yeah, a text run is the thing in the box tree that represents a sequence of adjacent DOM text nodes in the element tree. Basically:

    • The DOM tree contains element nodes, text nodes, comment nodes, doctype nodes, etc.
    • The element tree contains elements, pseudo-elements, and text nodes.
    • The box tree contains boxes (representing elements or pseudo-elements) and text runs (representing sequences of text nodes).
  3. fantasai commented on Dec 7, 2022

    @fantasai
    Collaborator

    Re-opening in response to @myakura's comment, because maybe we should rename “text run” to “text sequence”!

  4. dbaron commented on Dec 7, 2022

    @dbaron
    Member

    "text run" is a term used elsewhere for similar purposes, e.g. https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.textformatting.textrun?view=windowsdesktop-7.0 That said, I'm not sure if the use in the display spec matches the meaning in Gecko (where it has been used for a long time).

  5. fantasai commented on Dec 7, 2022

    @fantasai
    Collaborator

    @dbaron They're similar but not quite the same. IIRC text runs in Gecko can cross element boundaries, as long as there's no styling change that would create an interruption. Either way, though, I think it's worth using terminology that's less likely to confuse people.

  6. astearns commented on Dec 13, 2022

    @astearns
    Member

    I think “text run” is a term of art that does not quite match what is being described in the spec, and I don’t see a benefit in using that term that offsets the confusion being generated. So I support changing to “text sequence.”

  7. added and removed
    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.
    on Dec 13, 2022
  8. astearns commented on Dec 13, 2022

    @astearns
    Member

    Since this change is fairly low-impact we likely do not need to spend meeting time on it.

    The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment.

    Proposed Resolution: Change the term “text run” to “text sequence” in css-display-3

  9. 11 remaining items

  10. Loirooriol commented on Mar 14, 2023

    @Loirooriol
    Contributor

    @fantasai Why do flex and grid use different wordings now?

    and each contiguous sequence of child text sequences

    and each child text sequence

    I think the latter is better, "sequence of sequences" seems unnecessarily verbose.

  11. added a commit that references this issue on Mar 17, 2023
  12. fantasai commented on Mar 17, 2023

    @fantasai
    Collaborator

    @Loirooriol Fixed, thanks.

  13. SelenIT commented on Mar 18, 2023

    @SelenIT
    Collaborator

    I think the latter is better, "sequence of sequences" seems unnecessarily verbose.

    But doesn't it affect the meaning? Will "each child text sequence" not imply that each text sequence created by a display:contents child becomes a separate flex/grid item? I believe that "sequence of sequences" wording was specifically introduced to clarify that they will become a single flex/grid item (possibly with differently styled parts of text), though I agree that there should be better wording to express this intent.

  14. Loirooriol commented on Mar 19, 2023

    @Loirooriol
    Contributor

    Good point, I didn't consider display: contents.

  15. letochagone commented on Mar 12, 2026

    @letochagone
    Author

    @fantasai Perfect! It's much clearer now. Thank you!

  16. Loirooriol commented on Mar 24, 2026

    @Loirooriol
    Contributor

    Not perfect, it's wrong, see above

  17. ByteEater-pl commented on Apr 2, 2026

    @ByteEater-pl

    The term text run is also used in SVG.

  18. letochagone commented on May 10, 2026

    @letochagone
    Author

    I found another text where this "untranslatable" word is used:
    https://html.spec.whatwg.org/multipage/dom.html#phrasing-content

    Image
  19. SelenIT commented on May 13, 2026

    @SelenIT
    Collaborator

    Returning to the topic, I'd like to clarify the following piece of the current definition:

    Similarly, each contiguous sequence of sibling text nodes generates a text sequence containing their text contents, which is assigned the same styles as the generating text nodes.

    The part I emphasized seems a bit ambiguous to me: does it already imply that a single text sequence can contain parts of text with multiple different stylings (e.g. in case of display:contents) or not? If yes, the change above appears correct, but a separate term for each same-style sub-sequence would probably be needed. IIRC, the original "text run" term referred to the same-style sequences, and the "sequence of sequences" wording intended to highlight it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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