To reproduce, open the attached html file in Firefox or IE. Select the first table row by dragging the mouse across all content in the row and use Ctrl+C to copy the content. Open the same html file in Safari or Chrome and click into one of the table cells. Use Ctrl+V to paste the content. Problem: The table content is pasted as text, rather than within a table. Using a clipboard inspector, the table structure is correctly represented in the HTML format on the clipboard as shown below. It seems like Webkit is using the Text format from the clipboard instead of the HTML format. Clipboard HTML format in Firefox: Version:0.9 StartHTML:00000181 EndHTML:00000296 StartFragment:00000215 EndFragment:00000260 SourceURL:file:///C:/Documents%20and%20Settings/Teresa%20Monahan/Desktop/test.html <html><body> <!--StartFragment--><tr><td> ccc</td><td> ddd</td></tr><!--EndFragment--> </body> </html> Clipboard HTML format in Internet Explorer: Version:1.0 StartHTML:000000235 EndHTML:000000545 StartFragment:000000448 EndFragment:000000474 StartSelection:000000448 EndSelection:000000469 SourceURL:file:///C:/Documents%20and%20Settings/Teresa%20Monahan/Desktop/test.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD></HEAD> <BODY> <DIV id=myId contentEditable=true> <TABLE style="WIDTH: 500px" border=1> <TBODY> <TR><!--StartFragment--><TD>ccc</TD> <TD>ddd</TD><!--EndFragment--></TR> </TBODY> </TABLE> </DIV> </BODY> </HTML>
Created attachment 118804 [details] Test case to reproduce the issue
dcheng, do we still need to fix this for Windows port?
This was fixed in Chrome 16, but I believe it's still present in Safari since it doesn't pass in the entire string + fragment indices.
This is specific to Apple's Windows port now.
Note dcheng has added createFragmentFromMarkupWithContext to markup.cpp. It's just a matter of calling that function in ClipboardWin.cpp and related files.