Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
letochagone opened this issue Sep 20, 2022 · 16 comments
Open

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

letochagone opened this issue Sep 20, 2022 · 16 comments

Comments

@letochagone
Copy link

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.

@myakura
Copy link
Contributor

myakura commented Sep 20, 2022

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)

@Loirooriol
Copy link
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).

@tabatkins tabatkins added css-display-3 Current Work Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. labels Sep 21, 2022
@fantasai
Copy link
Collaborator

fantasai commented Dec 7, 2022

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

@fantasai fantasai reopened this Dec 7, 2022
@dbaron
Copy link
Member

dbaron commented Dec 7, 2022

"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).

@fantasai
Copy link
Collaborator

fantasai commented Dec 7, 2022

@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.

@astearns
Copy link
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.”

@astearns astearns added Async Resolution: Proposed Candidate for auto-resolve with stated time limit and removed Agenda+ Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. labels Dec 13, 2022
@astearns
Copy link
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

@astearns
Copy link
Member

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

@astearns astearns added Needs Edits and removed Async Resolution: Proposed Candidate for auto-resolve with stated time limit labels Dec 20, 2022
@myakura
Copy link
Contributor

myakura commented Dec 21, 2022

There are other specs that use "text run" as well. I see Text and Writing Modes use it. Does the resolution cover other specs?
https://drafts.csswg.org/css-text-4/#valdef-word-boundary-detection-normal
https://drafts.csswg.org/css-writing-modes-4/#text-combine-runs

@astearns
Copy link
Member

We would definitely need to change css-text since it links to the css-display definition. I think we should also change css-writing-modes for consistency.

@fantasai
Copy link
Collaborator

Yes, we would apply the change across all the CSS specs that reference the same concept.

@fantasai
Copy link
Collaborator

@letochagone Ok, I've updated the editor's draft in e0f9cb9 to use the word “text sequence”; hopefully this will be less confusing. :) Let me know what you think.

@myakura I also updated all of the other specs that seemed to be referencing the same concept. There remain some uses of “text run” in Writing Modes, Text, and Fonts which don't seem to be quite tied to the same box tree concept, so I left those alone. Feel free to file a follow-up issue if you think something is off. CC @svgeesus

@Loirooriol
Copy link
Contributor

Loirooriol commented Mar 14, 2023

@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.

fantasai added a commit that referenced this issue Mar 17, 2023
@fantasai
Copy link
Collaborator

@Loirooriol Fixed, thanks.

@SelenIT
Copy link
Collaborator

SelenIT commented Mar 18, 2023

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.

@Loirooriol
Copy link
Contributor

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

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

No branches or pull requests

8 participants