<?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>227337</bug_id>
          
          <creation_ts>2021-06-23 21:30:16 -0700</creation_ts>
          <short_desc>[Legacy line layout] Incorrect wrap position at &lt;wbr&gt; in &quot;white-space: pre&quot; content.</short_desc>
          <delta_ts>2021-06-30 21:31:21 -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>Layout and Rendering</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cameron McCormack (:heycam)">heycam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1772177</commentid>
    <comment_count>0</comment_count>
      <attachid>432131</attachid>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2021-06-23 21:30:16 -0700</bug_when>
    <thetext>Created attachment 432131
test

Noticed this looking at https://developer.apple.com/documentation/coretext/1510813-ctfontgetglyphsforcharacters?language=objc.

STR:

1. Open the attached test.
2. Click somewhere in the &quot;Char&quot; of &quot;UniChar&quot;.
3. Notice that the line of text wraps (and not all of it gets repainted).

Are we incorrectly computing the intrinsic minimum width of the text by not taking into account the word wrap opportunities?

Doesn&apos;t reproduce with LFC for inline layout turned off.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1772273</commentid>
    <comment_count>1</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2021-06-24 08:09:21 -0700</bug_when>
    <thetext>Yeah, it happens when legacy line layout and IFC disagrees on the layout.
According to https://www.w3.org/TR/css-text-3/#white-space-property, 
white-space: pre -&gt; &quot;Lines only break at forced line breaks; content that does not fit within the block container overflows it.&quot; 
While &lt;wbr&gt; acts as a line breaking opportunity, it is not a forced line break.
IFC layout also matches FF.
Sadly, clicking on the content forces us to fallback to legacy line layout and it makes the content wrap and we fail to make the containing block taller (as the fallback code only runs the line layout and not the block one)
We need to patch legacy line layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1772275</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2021-06-24 08:16:02 -0700</bug_when>
    <thetext>&gt;Are we incorrectly computing the intrinsic minimum width of the text by not taking into account the word wrap opportunities?
The content in inside a fixed width containing block, so we don&apos;t really compute intrinsic width here. It&apos;s simply about ignoring the soft line break opportunities (&lt;wbr&gt;) and letting the content overflow as specified by the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773992</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-30 21:31:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/80001586&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>432131</attachid>
            <date>2021-06-23 21:30:16 -0700</date>
            <delta_ts>2021-06-23 21:30:16 -0700</delta_ts>
            <desc>test</desc>
            <filename>out.html</filename>
            <type>text/html</type>
            <size>304</size>
            <attacher name="Cameron McCormack (:heycam)">heycam</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KLmNvbnRhaW5lciB7CiAgZm9udDogMTZweCBtb25vc3Bh
Y2U7CiAgd2lkdGg6IDgwY2g7CiAgYmFja2dyb3VuZC1jb2xvcjogeWVsbG93Owp9CnByZSB7CiAg
aGVpZ2h0OiAxMDBweDsKfQo8L3N0eWxlPgo8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogIDxwcmU+
Ym9vbCBDVEZvbnRHZXRHbHlwaHNGb3JDaGFyYWN0ZXJzKENURm9udDx3YnI+UmVmIGZvbnQsIGNv
bnN0IFVuaTx3YnI+Q2hhciAqY2hhcmFjdGVycywgQ0dHbHlwaCAqZ2x5cGhzLCBDRkluZGV4IGNv
dW50KTs8L3ByZT4KPC9kaXY+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>