<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>223289</bug_id>
          
          <creation_ts>2021-03-16 16:25:57 -0700</creation_ts>
          <short_desc>[Legacy Line Layout] Incorrect hanging glyph handling with white-space: pre-wrap</short_desc>
          <delta_ts>2024-06-29 05:15:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>Safari 14</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>CanvaBug, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mike</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>xidorn-webkit</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1740302</commentid>
    <comment_count>0</comment_count>
      <attachid>423412</attachid>
    <who name="">mike</who>
    <bug_when>2021-03-16 16:25:57 -0700</bug_when>
    <thetext>Created attachment 423412
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:

&gt; 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 &quot;_&quot;):

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


But right-aligned text renders like:

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

where the trailing spaces are collapsed.

Attached is an HTML file that demonstrates this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743063</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-03-23 16:26:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/75760533&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1775659</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2021-07-08 06:45:47 -0700</bug_when>
    <thetext>With the outline removed, IFC (modern line layout) renders the attached test case fine (atm the outline property forces us on the legacy codepath).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043750</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-06-29 04:30:39 -0700</bug_when>
    <thetext>@Alan - since now IFC is default, is it something we can close? Or we are still falling back on legacy for this outline case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043759</commentid>
    <comment_count>4</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-06-29 05:15:17 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #3)
&gt; @Alan - since now IFC is default, is it something we can close? Or we are
&gt; still falling back on legacy for this outline case?
There&apos;s no such thing as fallback anymore. This progressed with IFC &quot;long&quot; time ago.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>423412</attachid>
            <date>2021-03-16 16:25:57 -0700</date>
            <delta_ts>2021-03-16 16:25:57 -0700</delta_ts>
            <desc>An HTML file with two one-line paragraphs of text containing leading and trailing whitespace.</desc>
            <filename>pre-wrap.html</filename>
            <type>text/html</type>
            <size>440</size>
            <attacher>mike</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8bWV0YSBjaGFyc2V0PSJ1dGYtOCI+CiAg
PHRpdGxlPndoaXRlLXNwYWNlOiBwcmUtd3JhcDwvdGl0bGU+CiAgPHN0eWxlPgogIHAgewogICAg
b3V0bGluZTogMXB4IHNvbGlkIGJsdWU7CiAgICB3aWR0aDogMjAwcHg7CiAgICBmb250LXNpemU6
IDMycHg7CiAgICBmb250LWZhbWlseTogbW9ub3NwYWNlOwogICAgd2hpdGUtc3BhY2U6IHByZS13
cmFwOwogIH0KCiAgLmxlZnQgewogICAgdGV4dC1hbGlnbjogbGVmdDsKICB9CgogIC5yaWdodCB7
CiAgICB0ZXh0LWFsaWduOiByaWdodDsKICB9CgogIDwvc3R5bGU+CjwvaGVhZD4KPGJvZHk+CiAg
PGRpdj4KICAgIDxwIGNsYXNzPSJsZWZ0Ij4gIHRleHQgIDwvcD4KICAgIDxwIGNsYXNzPSJyaWdo
dCI+ICB0ZXh0ICA8L3A+CiAgPC9kaXY+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>