<?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>58842</bug_id>
          
          <creation_ts>2011-04-18 15:30:16 -0700</creation_ts>
          <short_desc>Dropping a file in a WKView (WebKit2) doesn&apos;t load the file</short_desc>
          <delta_ts>2011-04-18 16:09:44 -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>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Enrica Casucci">enrica</reporter>
          <assigned_to name="Enrica Casucci">enrica</assigned_to>
          <cc>jeffm</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>388104</commentid>
    <comment_count>0</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2011-04-18 15:30:16 -0700</bug_when>
    <thetext>Dragging a local .html into the current page doesn&apos;t show a &quot;+&quot; green circle nor does it allow dragging and dropping the site. This does work however when dragged and dropped to the toolbar.

Repro steps:
1. Launch Safari on Windows
2. Drag and drop a local .html file into into current page.
--Result: Local .html file is not displayed. Blue &apos;+ Copy&apos; displayed when hovering local .html file over current page instead of expected green &apos;+&apos;.
--Note: Drag and drop of local .html files into bookmarks toolbar functions as expected.

&lt;rdar://problem/8514409&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388110</commentid>
    <comment_count>1</comment_count>
      <attachid>90104</attachid>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2011-04-18 15:39:50 -0700</bug_when>
    <thetext>Created attachment 90104
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388120</commentid>
    <comment_count>2</comment_count>
      <attachid>90104</attachid>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-04-18 15:49:49 -0700</bug_when>
    <thetext>Comment on attachment 90104
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=90104&amp;action=review

&gt; Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp:447
&gt; +    RetainPtr&lt;CFStringRef&gt; pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData.charactersWithNullTermination(), wcslen(stringData.charactersWithNullTermination())));

Can&apos;t you just do: RetainPtr&lt;CFStringRef&gt; pathAsCFString(AdoptCF, stringData.createCFString());</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388129</commentid>
    <comment_count>3</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-04-18 15:56:33 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 90104 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=90104&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp:447
&gt; &gt; +    RetainPtr&lt;CFStringRef&gt; pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData.charactersWithNullTermination(), wcslen(stringData.charactersWithNullTermination())));
&gt; 
&gt; Can&apos;t you just do: RetainPtr&lt;CFStringRef&gt; pathAsCFString(AdoptCF, stringData.createCFString());

Ignore that comment, I see that the problem you&apos;re addressing is that there is an extra null at the end, and createCFString() is using String::length(), which would be wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388130</commentid>
    <comment_count>4</comment_count>
      <attachid>90104</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2011-04-18 15:57:02 -0700</bug_when>
    <thetext>Comment on attachment 90104
Patch

r=me but please consider Jeff&apos;s suggestion when landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388139</commentid>
    <comment_count>5</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2011-04-18 16:06:46 -0700</bug_when>
    <thetext>In his last comment, Jeff told me to ignore his previous comment. In fact what I&apos;m removing is the use of String.length() to get rid of the extra 0 at the end.
Thanks for the review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>388144</commentid>
    <comment_count>6</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2011-04-18 16:09:44 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/84203</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>90104</attachid>
            <date>2011-04-18 15:39:50 -0700</date>
            <delta_ts>2011-04-18 15:57:02 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>urlwithextra0.txt</filename>
            <type>text/plain</type>
            <size>1787</size>
            <attacher name="Enrica Casucci">enrica</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDg0MTkxKQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTcgQEAKKzIwMTEtMDQtMTggIEVucmljYSBD
YXN1Y2NpICA8ZW5yaWNhQGFwcGxlLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkg
KE9PUFMhKS4KKworICAgICAgICBEcm9wc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wgRAogCiAgICAgaWYgKHN0cmluZ0RhdGEu
aXNFbXB0eSgpIHx8ICghUGF0aEZpbGVFeGlzdHMoc3RyaW5nRGF0YS5jaGFyYWN0ZXJzV2l0aE51
bGxUZXJtaW5hdGlvbigpKSAmJiAhUGF0aElzVU5DKHN0cmluZ0RhdGEuY2hhcmFjdGVyc1dpdGhO
dWxsVGVybWluYXRpb24oKSkpKQogICAgICAgICByZXR1cm4gdXJsOwotICAgIFJldGFpblB0cjxD
RlN0cmluZ1JlZj4gcGF0aEFzQ0ZTdHJpbmcoQWRvcHRDRiwgQ0ZTdHJpbmdDcmVhdGVXaXRoQ2hh
cmFjdGVycyhrQ0ZBbGxvY2F0b3JEZWZhdWx0LCAoY29uc3QgVW5pQ2hhciAqKXN0cmluZ0RhdGEu
Y2hhcmFjdGVyc1dpdGhOdWxsVGVybWluYXRpb24oKSwgc3RyaW5nRGF0YS5sZW5ndGgoKSkpOwor
ICAgIFJldGFpblB0cjxDRlN0cmluZ1JlZj4gcGF0aEFzQ0ZTdHJpbmcoQWRvcHRDRiwgQ0ZTdHJp
bmdDcmVhdGVXaXRoQ2hhcmFjdGVycyhrQ0ZBbGxvY2F0b3JEZWZhdWx0LCAoY29uc3QgVW5pQ2hh
ciAqKXN0cmluZ0RhdGEuY2hhcmFjdGVyc1dpdGhOdWxsVGVybWluYXRpb24oKSwgd2NzbGVuKHN0
cmluZ0RhdGEuY2hhcmFjdGVyc1dpdGhOdWxsVGVybWluYXRpb24oKSkpKTsKICAgICBpZiAodXJs
RnJvbVBhdGgocGF0aEFzQ0ZTdHJpbmcuZ2V0KCksIHVybCkgJiYgdGl0bGUpCiAgICAgICAgICp0
aXRsZSA9IHVybDsKICNlbmRpZgo=
</data>
<flag name="review"
          id="82827"
          type_id="1"
          status="+"
          setter="mjs"
    />
          </attachment>
      

    </bug>

</bugzilla>