[Webkit-unassigned] [Bug 223289] New: Trailing whitespace in a single-line paragraph sometimes collapsed with white-space: pre-wrap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 16 16:25:57 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223289

            Bug ID: 223289
           Summary: Trailing whitespace in a single-line paragraph
                    sometimes collapsed with white-space: pre-wrap
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Text
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mike at canva.com
                CC: mmaxfield at apple.com

Created attachment 423412

  --> https://bugs.webkit.org/attachment.cgi?id=423412&action=review

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210316/24c11708/attachment-0001.htm>


More information about the webkit-unassigned mailing list