Skip to content

Honor word-break and overflow-wrap in retained text layout #787

Description

@wieslawsoltes

Parent epic: #235
Related visual/layout owners: #240, #241, #259
Product investigations: #264 and the Markdown-preview/workbench rendering backlog

Problem

WebScene's retained text layout currently wraps only at whitespace. It does not parse or apply word-break, overflow-wrap, or the legacy word-wrap alias. A single long token therefore remains wider than its used content box even when unchanged Code OSS explicitly asks the browser to break it.

Unchanged Code OSS uses these properties in Markdown preview, dialogs, notifications, hover/parameter-hint content, quick input, suggestions, REPL/debug hovers, editor placeholders, comments, and chat/session surfaces. The Markdown extension specifically uses word-wrap: break-word and word-break: break-word.

Scope

  • Add canonical CSS property identity and CSSOM aliases for word-break, overflow-wrap, and word-wrap.
  • Preserve cascade, variables, global keywords, inheritance, inline mutation/removal, stylesheet replacement, computed style, and portable/compiler metadata.
  • Apply word-break: break-all, word-break: break-word, overflow-wrap: break-word, and overflow-wrap: anywhere to retained inline fragments and the fallback text-line path.
  • Split only at UTF-8 code-point boundaries and retain source byte ranges for selection/highlight paint.
  • Keep normal, initial, and keep-all on the existing whitespace-break behavior for the currently qualified Latin-oriented slice.
  • Avoid per-frame timers, document scans, platform text widgets, or application-specific CSS rewrites.

Gates to author

  • Browser-referenced contract for normal, break-all, break-word/anywhere, inheritance, aliasing, inline mutation/removal, and Unicode code-point boundaries.
  • Native retained-scene/layout regression proving long-token fragments remain within the used content width and paint/source ranges stay ordered.
  • Code OSS fixture covering Markdown text, dialog/notification text, parameter hints, and REPL-style pre-wrap content.
  • Performance gate with 4,096 text nodes and repeated width/style transitions. Bound line/fragments to O(code points), layout passes/publications to one per mutation, and wall time to a recorded budget.
  • Visual comparison against Chromium for representative Markdown/workbench states.

Acceptance

  • Long Code OSS Markdown/workbench tokens wrap within their boxes when authored CSS requests it.
  • word-wrap aliases overflow-wrap through authored and computed CSSOM.
  • Normal wrapping does not regress, UTF-8 is never split mid-code-point, and selection/highlight source ranges remain valid.
  • Cascade/global-keyword/variable/inheritance behavior agrees with Chromium for the bounded slice.
  • Correctness, visual, performance, lifecycle, and package gates have recorded evidence.

Current evidence

Source audit at WebScene dd03421e180546c39aa4c272396b36af628d38c5 and unchanged Code OSS 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c. No build, test, benchmark, visual, or packaged-product evidence has been run; evidence is zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions