Skip to content

Conversation

@CGQAQ
Copy link
Contributor

@CGQAQ CGQAQ commented Jan 26, 2026

Summary

Adds CSS Text Level 4 support for text-wrap and white-space-collapse, including their longhand/shorthand resolution so the Dart render style stays consistent when authors mix shorthands and longhands.

What’s included

  • text-wrap shorthand + longhands: text-wrap-mode, text-wrap-style.
  • white-space-collapse as a longhand of white-space.
  • New property IDs/name mappings and initial values.
  • Updated render style resolution between white-space and its longhands, and between text-wrap and its longhands.
  • Bridge style engine cleanup: remove special-casing that synthesized white-space from longhands; rely on Dart-side resolution.

Supported values

  • white-space-collapse: collapse | preserve | preserve-breaks | break-spaces
  • text-wrap: wrap | nowrap | balance | pretty
  • text-wrap-mode: wrap | nowrap
  • text-wrap-style: auto | balance | pretty

Behavior notes

  • Setting white-space updates white-space-collapse + text-wrap-mode, but does not override text-wrap-style.
  • Computed text-wrap derives from (text-wrap-mode, text-wrap-style): nowrap when mode is nowrap, otherwise wrap/balance/pretty based on style.

Tests

  • Added webf/test/src/css/white_space_longhands_test.dart.
  • Run: cd webf && flutter test test/src/css/white_space_longhands_test.dart

@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
use-case Ready Ready Preview, Comment Jan 26, 2026 11:09am
vue_usecase Ready Ready Preview, Comment Jan 26, 2026 11:09am

Request Review

…perties

- Introduced `text-wrap` shorthand and its longhands: `text-wrap-mode`, `text-wrap-style`.
- Added `white-space-collapse` as a `white-space` longhand.
- Enhanced rendering logic to resolve shorthand and longhand properties.
- Updated tests to validate property application and inheritance behaviors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants