Skip to content

Collapse repeated whitespace for normal and nowrap #902

Open

Description

@Ernxst

Chromium collapses consecutive spaces in white-space: normal, but GPU-IX paints both spaces and can move later words to another line.

This reproduces on GPU-IX main (6b1eb39bf94c60af99379a1b94af4e9616bc461e):

<text style={{ width: 320, fontFamily: "Avenir Next", fontSize: 13, lineHeight: "16px", whiteSpace: "normal" }}>
  {"aa  bb"}
</text>

Chromium paints aa bb on one line. GPU-IX retains the two authored spaces and paints aa bb. In the final verification for PR #869, the same text at a narrow probe width produced aa / bb in Chromium and aa / b / b in GPU-IX. That run did not record the narrow probe's width.

GPU-IX sends the original text to GPUI's shape_text path without collapsing whitespace. Collapse runs of spaces and tabs to one space under normal and nowrap, convert newlines to spaces, and remove spaces at a wrapped line start. Keep the authored text available to accessibility and selection APIs.

Done means focused line-layout tests cover a fitting line, a break between words, and spaces at the start of a wrapped line; GPU-IX matches Chromium's visible text and line strings in each case.

Activity

  1. added this to the 0.27.1-fork milestone on Oct 2, 2026
  2. self-assigned this
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions