Bug 223289

Summary: [Legacy Line Layout] Incorrect hanging glyph handling with white-space: pre-wrap
Product: WebKit Reporter: mike
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, mmaxfield, webkit-bug-importer, xidorn-webkit, zalan
Priority: P2 Keywords: CanvaBug, InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 10.15   
Attachments:
Description Flags
An HTML file with two one-line paragraphs of text containing leading and trailing whitespace. none

Description mike 2021-03-16 16:25:57 PDT
Created attachment 423412 [details]
An HTML file with two one-line paragraphs of text containing leading and trailing whitespace.

According to https://www.w3.org/TR/css-text-3/#collapse:

> If white-space is set to pre, pre-wrap, or break-spaces, any sequence of spaces is treated as a sequence of non-breaking spaces.

This seems to be the case in Safari 14 for left-aligned paragraphs. But not 

But for for a text element with leading and trailing spaces, text renders like the following (with spaces represented as "_"):

+---------------+
|__text__       |
+---------------+


But right-aligned text renders like:

+---------------+
|         __text|
+---------------+

where the trailing spaces are collapsed.

Attached is an HTML file that demonstrates this.
Comment 1 Radar WebKit Bug Importer 2021-03-23 16:26:11 PDT
<rdar://problem/75760533>
Comment 2 zalan 2021-07-08 06:45:47 PDT
With the outline removed, IFC (modern line layout) renders the attached test case fine (atm the outline property forces us on the legacy codepath).
Comment 3 Ahmad Saleem 2024-06-29 04:30:39 PDT
@Alan - since now IFC is default, is it something we can close? Or we are still falling back on legacy for this outline case?
Comment 4 zalan 2024-06-29 05:15:17 PDT
(In reply to Ahmad Saleem from comment #3)
> @Alan - since now IFC is default, is it something we can close? Or we are
> still falling back on legacy for this outline case?
There's no such thing as fallback anymore. This progressed with IFC "long" time ago.