<?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>10634</bug_id>
          
          <creation_ts>2006-08-29 15:26:48 -0700</creation_ts>
          <short_desc>-webView:dragDestinationActionMaskForDraggingInfo: is ignored</short_desc>
          <delta_ts>2006-08-30 09:43:45 -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>WebKit API</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>0</everconfirmed>
          <reporter name="Karl Adam">karl.adam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54194</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Adam">karl.adam</who>
    <bug_when>2006-08-29 15:26:48 -0700</bug_when>
    <thetext>I&apos;ve been having problems where some files were accepted as drops on my custom WebView and others were not, after some debugging I&apos;ve tracked down where it all screws up and am lost on why it does it at all.

In WebHTMLView on Line 5906 the line:
  if (actionMask &amp; WebDragDestinationActionDHTML) ...

CHANGES actionMask from it&apos;s original value to 0. This shouldn&apos;t be happening and I can&apos;t figure out why it&apos;s happening at all, but stepping through the code several times has done it every single time.

After the actionMask has been changed to 0, it of course discards the drag operation since it thinks it&apos;s uninterested in the drag and as a result my code waiting on the drop is never called, and the green + icon for copy drags never happens. So basically drags that should be working, fail.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54201</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-08-29 15:44:12 -0700</bug_when>
    <thetext>For reference, the line mentioned appears at WebKit/WebView/WebHTMLView.m:5706, not 5906.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54206</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Adam">karl.adam</who>
    <bug_when>2006-08-29 15:59:28 -0700</bug_when>
    <thetext>he way I&apos;ve been able to reproduce the bug so far is by having a subclass of WebView in my application that is it&apos;s own delegate and returns WebDragDestinationAny for -webView:dragDestinationActionMaskForDraggingInfo: And Mark row is correct, I mistyped 5906 when I meant 5706.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54214</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Adam">karl.adam</who>
    <bug_when>2006-08-29 17:53:22 -0700</bug_when>
    <thetext>After building everything clean and relaunching Xcode, this is not the source of the problem, just a debugging snafu. Instead it seems what initially thought was the problem, is the problem. 

IN WebNSViewExtras -_web_dragOperationForDraggingInfo: method, [[sender draggingPasteboard] _web_bestURL] is called, and _web_bestURL returns nil if it doesn&apos;t know how to display the file type, or handle the schema. So when [WebView canShowFile:] returns NO, it jumps out, and returns nil thus causing the original webDrag method to return NSDragOperationNone and ignore the drag entirely.

I&apos;d submit a patch to just remove the check for canShowFile: since a method called web_bestURL: shouldn&apos;t be concerned with whether or not the view can show the URL, merely return the most appropriate URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54216</commentid>
    <comment_count>4</comment_count>
      <attachid>10311</attachid>
    <who name="Karl Adam">karl.adam</who>
    <bug_when>2006-08-29 19:33:42 -0700</bug_when>
    <thetext>Created attachment 10311
Fix file drags not natively understood by WebKit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54217</commentid>
    <comment_count>5</comment_count>
      <attachid>10311</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-08-29 19:56:37 -0700</bug_when>
    <thetext>Comment on attachment 10311
Fix file drags not natively understood by WebKit

A couple nits.

1.  * ChangeLog doesn&apos;t need to be in the changelog.  (That often happens when you run prepare-ChangeLog twice.)

2.  Normally changes require a copyright line.  In this case, since these are &lt; 5 line changes, they probably don&apos;t.  But I just thought I should mention it for the future.

3.  Generally WebKit tries to avoid else statements after returns (as they&apos;re unnecessary.)    _web_dragOperationForDraggingInfo could be written cleaner by simply returning NSDragOperationCopy inside the if block and returning NSDragOperationNone outside. Execution only hits the outer return if it didn&apos;t trip the if.

Otherwise looks good.

I think we should do one more round on this patch to fix the nits.  (Since it&apos;s your first patch, it&apos;s good to be extra picky.)  But the substance looks fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54233</commentid>
    <comment_count>6</comment_count>
      <attachid>10316</attachid>
    <who name="Karl Adam">karl.adam</who>
    <bug_when>2006-08-30 09:26:34 -0700</bug_when>
    <thetext>Created attachment 10316
Second swipe at drag patch with nits taken care of</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54234</commentid>
    <comment_count>7</comment_count>
      <attachid>10316</attachid>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-08-30 09:34:14 -0700</bug_when>
    <thetext>Comment on attachment 10316
Second swipe at drag patch with nits taken care of

This is good. I will take the old ChangeLog and use it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54235</commentid>
    <comment_count>8</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-08-30 09:43:45 -0700</bug_when>
    <thetext>Landed in r16112.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>10311</attachid>
            <date>2006-08-29 19:33:42 -0700</date>
            <delta_ts>2006-08-30 09:26:34 -0700</delta_ts>
            <desc>Fix file drags not natively understood by WebKit</desc>
            <filename>WebKit drag.patch</filename>
            <type>text/plain</type>
            <size>2110</size>
            <attacher name="Karl Adam">karl.adam</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViS2l0L0NoYW5nZUxvZwko
cmV2aXNpb24gMTYxMDgpCisrKyBXZWJLaXQvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0x
LDMgKzEsMjYgQEAKKzIwMDYtMDgtMjkgIEthcmwgQWRhbSAgPGthcmxhZGFtQHlhaG9vLWluYy5j
b20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBD
aGFuZ2VMb2c6CisgICAgICAgICogTWlzYy9XZWJOU1Bhc3RlYm9hcmRFeHRyYXMubToKKyAgICAg
ICAgKC1bTlNQYXN0ZWJvYXJkIF93ZWJfYmVzdFVSTF0pOgorICAgICAgICAqIE1pc2MvV2ViTlNW
aWV3RXh0cmFzLm06CisgICAgICAgICgtW05TVmlldyBfd2ViX2RyYWdPcGVyYXRpb25Gb3JEcmFn
Z2luZ0luZm86XSk6CisKCiAyMDA2LTA4LTI5ICBCcmFkeSBFaWRzb24gIDxiZWlkc29uQGFwcGxl
LmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBieSBUaW0gSGF0Y2hlcnMgcnViYmVyIHN0YW1wCklu
ZGV4OiBXZWJLaXQvTWlzYy9XZWJOU1Bhc3RlYm9hcmRFeHRyYXMubQo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBX
ZWJLaXQvTWlzYy9XZWJOU1Bhc3RlYm9hcmRFeHRyYXMubQkocmV2aXNpb24gMTYxMDMpCisrKyBX
ZWJLaXQvTWlzYy9XZWJOU1Bhc3RlYm9hcmRFeHRyYXMubQkod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yYWdnaW5nSW5mbz4pc2VuZGVyCiB7CisgICAgTlNEcmFnT3BlcmF0aW9uIHJldHVy
bk9wZXJhdGlvbiA9IE5TRHJhZ09wZXJhdGlvbk5vbmU7CisgICAgCiAgICAgaWYgKCFbTlNBcHAg
bW9kYWxXaW5kb3ddICYmIAogICAgICAgICAhW1tzZWxmIHdpbmRvd10gYXR0YWNoZWRTaGVldF0g
JiYKICAgICAgICAgW3NlbmRlciBkcmFnZ2luZ1NvdXJjZV0gIT0gc2VsZiAmJgogICAgICAgICBb
W3NlbmRlciBkcmFnZ2luZ1Bhc3RlYm9hcmRdIF93ZWJfYmVzdFVSTF0pIHsKLSAgICAgICAgcmV0
dXJuIE5TRHJhZ09wZXJhdGlvbkNvcHk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcmV0dXJuIE5T
RHJhZ09wZXJhdGlvbk5vbmU7CisKKyAgICAgICAgcmV0dXJuT3BlcmF0aW9uID0gTlNEcmFnT3Bl
cmF0aW9uQ29weTsKICAgICB9CisgICAgCisgICAgcmV0dXJuIHJldHVybk9wZXJhdGlvbjsKIH0K
IAogLSAodm9pZClfd2ViX0RyYWdJbWFnZUZvckVsZW1lbnQ6KERPTUVsZW1lbnQgKillbGVtZW50
Cg==
</data>
<flag name="review"
          id="3261"
          type_id="1"
          status="-"
          setter="eric"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>10316</attachid>
            <date>2006-08-30 09:26:34 -0700</date>
            <delta_ts>2006-08-30 09:34:14 -0700</delta_ts>
            <desc>Second swipe at drag patch with nits taken care of</desc>
            <filename>WebKit drag take 2.patch</filename>
            <type>text/plain</type>
            <size>1311</size>
            <attacher name="Karl Adam">karl.adam</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9NaXNjL1dlYk5TUGFzdGVib2FyZEV4dHJhcy5tCj09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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1ZpZXdFeHRyYXMubQkod29ya2luZyBjb3B5KQpAQCAtMTU0LDEwICsxNTQsMTEg
QEAKICAgICAgICAgIVtbc2VsZiB3aW5kb3ddIGF0dGFjaGVkU2hlZXRdICYmCiAgICAgICAgIFtz
ZW5kZXIgZHJhZ2dpbmdTb3VyY2VdICE9IHNlbGYgJiYKICAgICAgICAgW1tzZW5kZXIgZHJhZ2dp
bmdQYXN0ZWJvYXJkXSBfd2ViX2Jlc3RVUkxdKSB7CisKICAgICAgICAgcmV0dXJuIE5TRHJhZ09w
ZXJhdGlvbkNvcHk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcmV0dXJuIE5TRHJhZ09wZXJhdGlv
bk5vbmU7CiAgICAgfQorICAgIAorICAgIHJldHVybiBOU0RyYWdPcGVyYXRpb25Ob25lOwogfQog
CiAtICh2b2lkKV93ZWJfRHJhZ0ltYWdlRm9yRWxlbWVudDooRE9NRWxlbWVudCAqKWVsZW1lbnQK
</data>
<flag name="review"
          id="3263"
          type_id="1"
          status="+"
          setter="timothy"
    />
          </attachment>
      

    </bug>

</bugzilla>