<?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>17645</bug_id>
          
          <creation_ts>2008-03-02 23:18:08 -0800</creation_ts>
          <short_desc>DOM ClipboardData.setData does not allow writes during clipboard events</short_desc>
          <delta_ts>2023-04-06 04:55: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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Mark Rowe (bdash)">mrowe</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aljungberg</cc>
    
    <cc>arv</cc>
    
    <cc>dcheng</cc>
    
    <cc>dimitri</cc>
    
    <cc>jparent</cc>
    
    <cc>kpiascik</cc>
    
    <cc>nanne</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72546</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-02 23:18:08 -0800</bug_when>
    <thetext>* SUMMARY
The current ClipboardWin implementation does not allow writing to the system clipboard.  This affects DOM clipboard events.

This prevents developers from writing custom content to the system clipboard during DOM clipboard events (eg. cut, copy, paste)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72547</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-02 23:18:39 -0800</bug_when>
    <thetext>&lt;rdar://problem/5015941&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72576</commentid>
    <comment_count>2</comment_count>
      <attachid>19495</attachid>
    <who name="Nicholas C. Zakas">webkit</who>
    <bug_when>2008-03-03 10:21:59 -0800</bug_when>
    <thetext>Created attachment 19495
Test case showing clipboard not working

In theory, you should be able to override the default copy/cut behavior of the clipboard and set your own data. This example overrides the default copy behavior and shows that the call to setData() does not result in text being put on the clipboard.

User agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/523.15 (KHTML, like Gecko) Version/3.0 Safari/523.15

The same example works fine on Macintosh.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88442</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov">dimitri</who>
    <bug_when>2008-08-13 15:34:57 -0700</bug_when>
    <thetext>I am wondering why we couldn&apos;t get away with wiring the generic Pasteboard::writeURL, etc. into ClipboardWin for non-drag operations?

olliej mentioned on #webkit that the problem is in setData deleting existing clipboard content, but I am not sure I understand why this is the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>330053</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-05 23:13:07 -0800</bug_when>
    <thetext>*** Bug 34020 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>330055</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-05 23:13:20 -0800</bug_when>
    <thetext>*** Bug 25715 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1946983</commentid>
    <comment_count>6</comment_count>
    <who name="Nanne Wielinga">nanne</who>
    <bug_when>2023-04-06 04:55:35 -0700</bug_when>
    <thetext>Similar kind of bug related to: clipboardData.setData

If there is a : inside one of the line from data, then all the enters are removed.

Example: https://jsfiddle.net/pzqe18dw/
Copy from bottom textarea and paste somewhere else.

Code:
clipboardData.setData(&quot;text/plain&quot;, `test: 1\ntest2\ntest3`)

Results into (broken):

test: 1test2test3

Instead of (expected):

test: 1
test2
test3</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>19495</attachid>
            <date>2008-03-03 10:21:59 -0800</date>
            <delta_ts>2008-03-03 10:21:59 -0800</delta_ts>
            <desc>Test case showing clipboard not working</desc>
            <filename>ClipboardExample.htm</filename>
            <type>text/html</type>
            <size>688</size>
            <attacher name="Nicholas C. Zakas">webkit</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgogICAgPHRpdGxlPldlYktpdCBDbGlwYm9hcmQgUHJvYmxlbTwvdGl0bGU+
CjwvaGVhZD4KPGJvZHk+CiAgICBDb3B5IHRleHQgZnJvbSBoZXJlIGFuZCBwYXN0ZSBpdCBzb21l
d2hlcmU6CiAgICA8aW5wdXQgdHlwZT0idGV4dCIgaWQ9InR4dFRlc3QiIC8+CiAgICA8c2NyaXB0
IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CiAgICAoZnVuY3Rpb24oKXsKCiAgICAgICAgdmFyIHRl
eHRib3ggPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgidHh0VGVzdCIpOwogICAgICAgIHRleHRi
b3gub25jb3B5ID0gZnVuY3Rpb24oZXZlbnQpewogICAgICAgICAgICAvL292ZXJyaWRlIGRlZmF1
bHQgb3BlcmF0aW9uCiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAg
ICAgIAogICAgICAgICAgICAvL3NldCB0aGUgdGV4dCBJIHdhbnQKICAgICAgICAgICAgaWYgKCFl
dmVudC5jbGlwYm9hcmREYXRhLnNldERhdGEoInRleHQvcGxhaW4iLCAiSGVsbG8gd29ybGQhIikp
ewogICAgICAgICAgICAgICAgYWxlcnQoIkNsaXBib2FyZCBzZXQgZmFpbGVkLiIpOwogICAgICAg
ICAgICB9CiAgICAgICAgCiAgICAgICAgfTsKICAgIAogICAgCiAgICB9KSgpOwogICAgZG9jdW1l
bnQud3JpdGUobmF2aWdhdG9yLnVzZXJBZ2VudCk7CiAgICA8L3NjcmlwdD4KCjwvYm9keT4KPC9o
dG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>