<?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>75891</bug_id>
          
          <creation_ts>2012-01-09 14:37:05 -0800</creation_ts>
          <short_desc>Safari fails to fire paste events</short_desc>
          <delta_ts>2026-03-12 19:10:54 -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>525.x (Safari 3.2)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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 Kristensson">mkbitbucket</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>alexandre.wilhelmfr</cc>
    
    <cc>alexei.alexandrov</cc>
    
    <cc>aljungberg</cc>
    
    <cc>andrew.hankinson</cc>
    
    <cc>ap</cc>
    
    <cc>bdakin</cc>
    
    <cc>daniel.boehringer</cc>
    
    <cc>duardeco</cc>
    
    <cc>enrica</cc>
    
    <cc>martin</cc>
    
    <cc>nik.kyriakides</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
    
    <cc>sorin.sbarnea</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>532538</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Kristensson">mkbitbucket</who>
    <bug_when>2012-01-09 14:37:05 -0800</bug_when>
    <thetext>Safari fails to fire paste events (onpaste, onbeforepaste) attached to the document (or body) when Cmd-V is pressed and the focus is not in a text input or text area node. Prior to Lion, the onBeforePaste event fired allowing us to execute JS that put the focus into a (hidden) textarea when then accepted the paste.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>900312</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Ljungberg">aljungberg</who>
    <bug_when>2013-06-13 16:00:39 -0700</bug_when>
    <thetext>I can confirm this is still a problem in Safari 6.0.4 running in Mac OS X 10.8 (Mountain Lion). The &quot;beforepaste&quot; handler does not fire:

- when Cmd-V is pressed
- or when the Edit menu is opened
- regardless of if it&apos;s attached to the window or document
- with or without the &quot;capture&quot; flag set for addEventListener
- with or without spelling the handler &quot;beforepaste&quot; or &quot;onbeforepaste&quot; (as a long fixed Safari bug required).
- nor if &quot;beforepaste&quot; is attached to every dom element in the whole document

This makes it seem pretty much impossible to paste into anything but a textfield or a textarea in Safari. In Cappuccino, we often have non-traditional editable controls (token fields, collection views, tables) where you&apos;d expect to be able to paste.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>900333</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Ljungberg">aljungberg</who>
    <bug_when>2013-06-13 17:18:25 -0700</bug_when>
    <thetext>The problem seems to exist in the Webkit Nightly build too (WebKit r151570).

Speaking without any experience on the WebKit source code, this code in EditorCommand.cpp:1277 looks a bit suspicious:

static bool enabledPaste(Frame* frame, Event*, EditorCommandSource)
{
    return frame-&gt;editor().canPaste();
}

Compare that to the same file, line 1234:

static bool enabledCopy(Frame* frame, Event*, EditorCommandSource)
{
    return frame-&gt;editor().canDHTMLCopy() || frame-&gt;editor().canCopy();
}

enabledCut works similarly. So at least in this instance, paste seems to be treated differently than cut and copy, and canDHTMLPaste() is never consulted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1006892</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Böhringer">daniel.boehringer</who>
    <bug_when>2014-05-06 01:34:33 -0700</bug_when>
    <thetext>i can confirm that the issue is still present in Safari 7.0.2. Works in Chrome/FF.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009492</commentid>
    <comment_count>4</comment_count>
    <who name="Sorin Sbarnea">sorin.sbarnea</who>
    <bug_when>2014-05-15 02:49:40 -0700</bug_when>
    <thetext>And more important, why is this still unconfirmed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1022164</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Böhringer">daniel.boehringer</who>
    <bug_when>2014-07-13 22:52:12 -0700</bug_when>
    <thetext>i herewith confirm that this bug is still present in safari 7.0.5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1022190</commentid>
    <comment_count>6</comment_count>
    <who name="Andrew Hankinson">andrew.hankinson</who>
    <bug_when>2014-07-14 02:09:15 -0700</bug_when>
    <thetext>This bug should be re-classified to Macintosh Mac OS X 10.9+ and Safari 9537.77.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031040</commentid>
    <comment_count>7</comment_count>
    <who name="Daniel Böhringer">daniel.boehringer</who>
    <bug_when>2014-08-24 23:44:58 -0700</bug_when>
    <thetext>still an issue in Version 7.0.6 (9537.78.2)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042315</commentid>
    <comment_count>8</comment_count>
    <who name="Daniel Böhringer">daniel.boehringer</who>
    <bug_when>2014-10-17 00:09:09 -0700</bug_when>
    <thetext>still an issue on safari 8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042493</commentid>
    <comment_count>9</comment_count>
    <who name="Martin Carlberg">martin</who>
    <bug_when>2014-10-17 15:13:01 -0700</bug_when>
    <thetext>This is a very annoying bug. We have hundreds of users on our webapp and we have to recommend them to use another browser. Very sad...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1043583</commentid>
    <comment_count>10</comment_count>
    <who name="Alexandre Wilhelm">alexandre.wilhelmfr</who>
    <bug_when>2014-10-22 16:17:29 -0700</bug_when>
    <thetext>Any news of this issue ? We would like to support safari for our application, but this is impossible because this issue...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133773</commentid>
    <comment_count>11</comment_count>
    <who name="Alexey Alexandrov">alexei.alexandrov</who>
    <bug_when>2015-10-15 22:44:37 -0700</bug_when>
    <thetext>The issue seems to exist in Safari 9 too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1146660</commentid>
    <comment_count>12</comment_count>
    <who name="Nicholas Kyriakides">nik.kyriakides</who>
    <bug_when>2015-12-05 20:03:38 -0800</bug_when>
    <thetext>+1 - If this is not fixed, we need to use a contenteditable div to catch the paste even t which makes everything more complicated when interacting with the document</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200444</commentid>
    <comment_count>13</comment_count>
    <who name="Eduard Kyvenko">duardeco</who>
    <bug_when>2016-06-08 07:54:56 -0700</bug_when>
    <thetext>Doesn&apos;t work in Safari 9.1, El Capitan
contentEditable property helps as a workaround</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503212</commentid>
    <comment_count>14</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:18:38 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526622</commentid>
    <comment_count>15</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-04-11 21:26:49 -0700</bug_when>
    <thetext>&lt;rdar://problem/49839995&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2112369</commentid>
    <comment_count>16</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2025-04-22 01:42:49 -0700</bug_when>
    <thetext>Maybe this has been fixed by https://github.com/WebKit/WebKit/pull/38127?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2189841</commentid>
    <comment_count>17</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2026-03-12 19:10:54 -0700</bug_when>
    <thetext>Yup, this is fixed by https://github.com/WebKit/WebKit/pull/38127.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>