<?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>186224</bug_id>
          
          <creation_ts>2018-06-01 21:41:55 -0700</creation_ts>
          <short_desc>Copying from inline flex behaves like block level elements.</short_desc>
          <delta_ts>2019-04-11 21:24:35 -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>Safari 11</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</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="Samuel Williams">samuel</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>megan_gardner</cc>
    
    <cc>rniwa</cc>
    
    <cc>samuel</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1429505</commentid>
    <comment_count>0</comment_count>
    <who name="Samuel Williams">samuel</who>
    <bug_when>2018-06-01 21:41:55 -0700</bug_when>
    <thetext>When copying the text from

```
&lt;div style=&quot;display: inline-flex; white-space: pre&quot;&gt;
  &lt;span&gt;This &lt;/span&gt;
  &lt;span&gt;is &lt;/span&gt;
  &lt;span&gt;flex &lt;/span&gt;
&lt;/div&gt;
```

The data that would be pasted would contain multiple lines:

```
This 
is 
flex 
```

And yet that is not similar to how it is presented in the browser:

```
This is flex
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429688</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-06-03 14:42:43 -0700</bug_when>
    <thetext>&lt;rdar://problem/40758006&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429750</commentid>
    <comment_count>2</comment_count>
    <who name="Samuel Williams">samuel</who>
    <bug_when>2018-06-03 20:44:29 -0700</bug_when>
    <thetext>I would like to add, this isn&apos;t just specific to inline-flex. It&apos;s possible that other flex box layouts do strange things when copying/pasting to plain text. Basically, copying/pasting from flex boxes generates unexpected output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429847</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-06-04 10:08:55 -0700</bug_when>
    <thetext>We don&apos;t have any code to handle flex box for copy &amp; paste so anything is possible. We probably need to do some work to support both flex box &amp; grid layouts in our copy &amp; paste logic somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1430369</commentid>
    <comment_count>4</comment_count>
    <who name="Samuel Williams">samuel</who>
    <bug_when>2018-06-05 22:24:53 -0700</bug_when>
    <thetext>I did work around the issue by using an `oncopy` event handler:

https://github.com/ioquatix/jquery-syntax/blob/3cf6353facbc807c94b53cdf48c372547b7ac089/source/jquery.syntax.core.js#L45-L66</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1525079</commentid>
    <comment_count>5</comment_count>
    <who name="Samuel Williams">samuel</who>
    <bug_when>2019-04-07 05:46:31 -0700</bug_when>
    <thetext>I am just reporting that this is still an issue. You can see a live example here:

https://www.codeotaku.com/journal/2018-06/improving-ruby-fibers/index

Try copying only the code, it will invoke the copy handler which copies it as plain text.

If you try to copy it including some of the preceding paragraph, it won&apos;t invoke the copy handler. If you paste the result into, say, TextEdit, you will get odd output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526621</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-04-11 21:24:35 -0700</bug_when>
    <thetext>Yes, this is an issue. We need to handle flexbox in our copy &amp; paste code. We don&apos;t currently have the support for it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>