<?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>276549</bug_id>
          
          <creation_ts>2024-07-12 14:19:08 -0700</creation_ts>
          <short_desc>Aware of pre-line value of CSS white-space property when copying a selection</short_desc>
          <delta_ts>2025-03-15 11:11:09 -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>HTML Editing</component>
          <version>WebKit Nightly 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, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>289597</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>karlcow</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2046009</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-12 14:19:08 -0700</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, I came across another failing test case:

Test Case: https://jasonwoof.com/downloads/pre-white.html

Self-explanatory - copy paste text and you will see &apos;Safari&apos; losing line-break while in case of Chrome Canary 128, it works same as above. Firefox Nightly 130 is also broken in weird way.

Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/3564239b151f615afca39cfd886d225a2b4740f8

WebKit Source: https://searchfox.org/wubkat/rev/1cd233f7b4c8aea2960227249d0a2f36aa52b1de/Source/WebCore/editing/TextIterator.cpp#669

This compiles:

if (isNewlineOrTab(rendererText[runStart])) {
                // We need to preserve new lines in case of Pre-line.
                if (renderer-&gt;style().whiteSpace() == WhiteSpace::PreLine)
                    emitCharacter(&apos;\n&apos;, textNode.copyRef(), nullptr, runStart, runStart);
                else 
                    emitCharacter(&apos; &apos;, textNode.copyRef(), nullptr, runStart, runStart + 1);
                m_offset = runStart + 1;
            } else {

____

While this compiles, it does not progress one subtest from attach test case, which might be totally different test case but just wanted to raise so we can track it.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2046011</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-12 14:25:43 -0700</bug_when>
    <thetext>In http://wpt.live/html/dom/elements/the-innertext-and-outertext-properties/getter.html:

It progress these two:

&gt; \n preserved (&quot;&lt;div style=&apos;white-space:pre-line&apos;&gt;abc\ndef&quot;)	
&gt; \r converted to newline (&quot;&lt;div style=&apos;white-space:pre-line&apos;&gt;abc\rdef&quot;)	


while fail:

&gt; \t converted to space (&quot;&lt;div style=&apos;white-space:pre-line&apos;&gt;abc\tdef&quot;)	

___

Which make sense since if we look into WebKit code, we have &apos;isNewlineOrTab&apos; while Blink has &apos;isNewline&apos;, so Blink already tackled &apos;tab&apos; separately. So I think we might need to do pre-requisite as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047266</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-07-19 14:20:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/132112490&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>