<?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>178058</bug_id>
          
          <creation_ts>2017-10-07 19:05:15 -0700</creation_ts>
          <short_desc>dataTransfer.effectAllowed returns &quot;all&quot; when it&apos;s set to &quot;copy&quot; or &quot;move&quot; during dragstart</short_desc>
          <delta_ts>2024-02-07 21:43:54 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://jsfiddle.net/4tfzmLwo/</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="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>darin</cc>
    
    <cc>govett</cc>
    
    <cc>vissu_nbkr</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1358004</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2017-10-07 19:05:15 -0700</bug_when>
    <thetext>When dataTransfer.effectAllowed to set to &quot;copy&quot;, &quot;move&quot;, etc... during dragstart,
a subsequent drag event&apos;s dataTransfer&apos;s effectAllowed always returns &quot;all&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1358005</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-07 19:05:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/34874174&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1358012</commentid>
    <comment_count>2</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2017-10-07 19:21:50 -0700</bug_when>
    <thetext>Small test case showing the problem:

&lt;div id=&quot;source&quot; draggable=&quot;true&quot;&gt;Drag me!&lt;/div&gt;
&lt;script&gt;
function write(text) {
    let element = document.createElement(&quot;pre&quot;);
    element.textContent = text;
    document.body.appendChild(element);
}

function writeEffectAllowed(event) {
    write(`(${event.type}): effectAllowed = ${event.dataTransfer.effectAllowed}`);
    event.preventDefault();
}

source.addEventListener(&quot;dragstart&quot;, event =&gt; {
    event.dataTransfer.effectAllowed = &quot;move&quot;;
    write(&quot;Setting the effect allowed to move!&quot;);
});
document.body.addEventListener(&quot;dragover&quot;, writeEffectAllowed);
document.body.addEventListener(&quot;drop&quot;, writeEffectAllowed);
&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1580001</commentid>
    <comment_count>3</comment_count>
    <who name="Vishnu">vissu_nbkr</who>
    <bug_when>2019-10-14 22:54:01 -0700</bug_when>
    <thetext>Setting effectAllowed to &apos;copy&apos; or &apos;move&apos; has no effect in safari.  The effectAllowed is always copyMove</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895680</commentid>
    <comment_count>4</comment_count>
    <who name="Devon Govett">govett</who>
    <bug_when>2022-09-01 18:28:58 -0700</bug_when>
    <thetext>This is still a problem. The behavior is slightly different on macOS and iOS:

* On macOS, effectAllowed is always &quot;copyMove&quot; in the dragover event regardless of what was set during dragstart, unless a modifier key is set, in which case it is filtered to either copy or move. This also means that dropEffect can never be set to &quot;link&quot;, and holding the Control key results in effectAllowed being set to &quot;none&quot; rather than &quot;link&quot;.

  For drags initiated outside the browser, e.g. in Finder, effectAllowed is always &quot;all&quot; rather than &quot;copyMove&quot;, and &quot;link&quot; operations work as expected.

* On iOS, effectAllowed is always &quot;all&quot;. Modifier keys have no effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011645</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-07 21:43:54 -0800</bug_when>
    <thetext>*** Safari Technology Preview 188 ***

Copymove

*** Chrome Canary 123 ***

Does not allow &apos;text&apos; selection but show &apos;move&apos; when selected

*** Firefox Nightly 124 ***

Does not show any text like `copy move` or `move` but just:

&gt;&gt; Setting the effect allowed to move!

____

Just wanted to share up-to-date test results.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>