Bug 256927

Summary: [css-text-4] Implement `white-space-collapse` & `text-wrap` as longhands of `white-space`
Product: WebKit Reporter: David Choi <david_choi5>
Component: Layout and RenderingAssignee: David Choi <david_choi5>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, ntim, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description David Choi 2023-05-17 16:40:38 PDT
Replace the existing references to RenderStyle.whiteSpace() with references to the new longhand values (white-space-collapse and text-wrap).
https://drafts.csswg.org/css-text-4/#white-space-property
Comment 1 Radar WebKit Bug Importer 2023-05-17 16:42:12 PDT
<rdar://problem/109486221>
Comment 2 zalan 2023-05-17 17:23:50 PDT
(In reply to David Choi from comment #0)
> Replace the existing references to RenderStyle.whiteSpace() with references
> to the new longhand values (white-space-collapse and text-wrap).
will that include white-space-trim too?
Comment 3 Tim Nguyen (:ntim) 2023-05-25 21:31:40 PDT
(In reply to zalan from comment #2)
> (In reply to David Choi from comment #0)
> > Replace the existing references to RenderStyle.whiteSpace() with references
> > to the new longhand values (white-space-collapse and text-wrap).
> will that include white-space-trim too?

For the scope of this bug, I think we should exclude `white-space-trim` as all current `white-space` values map to `none`. Implementing the other values would be new functionality.
Comment 4 David Choi 2023-05-31 15:45:40 PDT
For now, existing references to RenderStyle.whiteSpace() will remain as is, but the RenderStyle object itself will not hold a white-space member variable. Instead, it will hold white-space-collapse and text-wrap member variables that can reconstruct the proper value for white-space. These member variables will be set accordingly based on the parsed white-space shorthand keyword.

References to RenderStyle.setWhiteSpace() will be replaced with the appropriate references to RenderStyle.setWhiteSpaceCollapse() and RenderStyle.setTextWrap().
Comment 5 David Choi 2023-05-31 17:22:46 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14564
Comment 6 EWS 2023-06-16 22:58:25 PDT
Committed 265267@main (eff0d22edb04): <https://commits.webkit.org/265267@main>

Reviewed commits have been landed. Closing PR #14564 and removing active labels.