<?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>62047</bug_id>
          
          <creation_ts>2011-06-03 13:30:46 -0700</creation_ts>
          <short_desc>copy-paste breaks lists</short_desc>
          <delta_ts>2011-06-03 14:10:30 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>62041</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ojan Vafai">ojan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adele</cc>
    
    <cc>enrica</cc>
    
    <cc>evan</cc>
    
    <cc>leviw</cc>
    
    <cc>rniwa</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>415132</commentid>
    <comment_count>0</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-06-03 13:30:46 -0700</bug_when>
    <thetext>1. Load http://simple-rte.rniwa.com/?editor=%3Cdiv%3E%0A%3Cdiv%3E%0A%3Cul%20style%3D%22text-align%3Aright%3B%22%3E%3Cli%3EA%3C/li%3E%3C/ul%3E%0A%3Cdiv%3E%0A%20%20%20%20%3Cul%3E%0A%20%20%20%20%20%20%20%20%3Cli%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%20href%3D%22%22%3EB%3C/a%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cbr%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20C%20%0A%20%20%20%20%20%20%20%20%3C/li%3E%0A%20%20%20%20%3C/ul%3E%0A%3C/div%3E%0A%3C/div%3E%0A%3C/div%3E&amp;script=editor%28%29.focus%28%29%3B
2. Select all (e.g. cmd+a)
3. Copy
4. Paste

I&apos;d expect the html contents to be unmodified. Instead, the HTML changes considerably and the visual formatting is totally different.

HTML before:
&lt;div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align:right;&quot;&gt;&lt;li&gt;A&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;a href=&quot;&quot;&gt;B&lt;/a&gt;
            &lt;br&gt;
            C 
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

HTML after:
&lt;div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align:right;&quot;&gt;&lt;li&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;ul style=&quot;text-align: right; &quot;&gt;&lt;li&gt;A&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://simple-rte.rniwa.com/?editor=%3Cdiv%20id%3D%22root%22%20style%3D%22word-wrap%3A%20break-word%3B%20-khtml-nbsp-mode%3A%20space%3B%20-khtml-line-break%3A%20after-white-space%3B%22%20contenteditable%3D%22%22%3E%0A%3Cdiv%20id%3D%22test%22%20class%3D%22editing%22%3E%0A%3Cul%20style%3D%22text-align%3Aright%3B%22%3E%3Cli%3E%3Cmeta%20charset%3D%22utf-8%22%3E%3Cul%20style%3D%22text-align%3A%20right%3B%20%22%3E%3Cli%3EA%3C/li%3E%3C/ul%3E%3Cdiv%3E%3Cul%3E%3Cli%3E%3Ca%20href%3D%22http%3A//simple-rte.rniwa.com/%3Feditor%3D%253Cul%253E%253Cli%253Ehello%253C/li%253E%253Cli%253Eworld%253C/li%253E%253C/ul%253E%253Cdiv%253EWebKit%253C/div%253E%26amp%3Bscript%3Deditor%2528%2529.focus%2528%2529%253B%22%3EB%3C/a%3E%26nbsp%3B%3Cbr%3EC%3C/li%3E%3C/ul%3E%3C/div%3E%3C/li%3E%3C/ul%3E%3Cdiv%3E%3Cul%3E%0A%20%20%20%20%3C/ul%3E%0A%3C/div%3E%0A%3C/div%3E%0A%3C/div%3E&amp;amp;script=editor%28%29.focus%28%29%3B&quot;&gt;B&lt;/a&gt;&amp;nbsp;&lt;br&gt;C&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul&gt;
    &lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

I see a few problems with this:
1. The structure of the list items has changed resulting in all the text being right aligned and some bullets being nested.
2. Why is there a meta tag??
3. Why do we resolve the href instead of leaving it as an empty string?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415136</commentid>
    <comment_count>1</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-06-03 13:36:02 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; 3. Why do we resolve the href instead of leaving it as an empty string?

We resolve relative links at copy time.  Otherwise, the links might not work when you paste back the contents.

IIRC, there may be different behaviors with Safari because it uses the WebArchive format when copying HTML and the WebArchive format includes meta data like the base URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415137</commentid>
    <comment_count>2</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-06-03 13:40:51 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; 3. Why do we resolve the href instead of leaving it as an empty string?
&gt; 
&gt; We resolve relative links at copy time.  Otherwise, the links might not work when you paste back the contents.

Oh right. I forgot about this. I remember there being no good way to fix this. So, nevermind about this issue. Lets have this bug focus on (1) and (2).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415141</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-06-03 13:42:45 -0700</bug_when>
    <thetext>Meta element shouldn&apos;t be there in ToT.  I recently added a logic to remove them</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415145</commentid>
    <comment_count>4</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-06-03 13:46:47 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Meta element shouldn&apos;t be there in ToT.  I recently added a logic to remove them

Oh great. Sorry, I&apos;m in Chrome beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415167</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-06-03 14:02:30 -0700</bug_when>
    <thetext>What I get on ToT:
&lt;div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align:right;&quot;&gt;&lt;ul style=&quot;text-align: right; &quot;&gt;&lt;li&gt;A&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B&lt;/a&gt;&amp;nbsp;&lt;br&gt;C&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul&gt;
    &lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415172</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-06-03 14:04:36 -0700</bug_when>
    <thetext>Why don&apos;t we merge this bug with 62041 since copying &amp; pasting all is exactly what editing/pasteboard/paste-4039777-fix.html tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>415187</commentid>
    <comment_count>7</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-06-03 14:10:30 -0700</bug_when>
    <thetext>Ah, sorry, I didn&apos;t realize that the differences I was seeing were because I wasn&apos;t on tip of tree.

*** This bug has been marked as a duplicate of bug 62041 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>