Bug 223289 - [Legacy Line Layout] Incorrect hanging glyph handling with white-space: pre-wrap
Summary: [Legacy Line Layout] Incorrect hanging glyph handling with white-space: pre-wrap
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: CanvaBug, InRadar
Depends on:
Blocks:
 
Reported: 2021-03-16 16:25 PDT by mike
Modified: 2024-06-29 05:15 PDT (History)
5 users (show)

See Also:


Attachments
An HTML file with two one-line paragraphs of text containing leading and trailing whitespace. (440 bytes, text/html)
2021-03-16 16:25 PDT, mike
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.