<?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>90425</bug_id>
          
          <creation_ts>2012-07-02 19:24:26 -0700</creation_ts>
          <short_desc>editing/pasteboard/dataTransfer-setData-getData.html hit ASSERT in KURL::KURL in Windows.</short_desc>
          <delta_ts>2012-07-07 01:17:28 -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>UNCONFIRMED</bug_status>
          <resolution></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="huangxueqing">huangxueqing</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>jberlin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>661893</commentid>
    <comment_count>0</comment_count>
    <who name="huangxueqing">huangxueqing</who>
    <bug_when>2012-07-02 19:24:26 -0700</bug_when>
    <thetext>editing/pasteboard/dataTransfer-setData-getData.html hit ASSERT(url == m_string) in KURL::KURL(). It seems that KURL always append a slash in the end of url if url did not include neither fragment nor query, but ClipboardWin::setData() construct KURL with a url which did not include a slash in the end of it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>664364</commentid>
    <comment_count>1</comment_count>
    <who name="huangxueqing">huangxueqing</who>
    <bug_when>2012-07-07 01:17:28 -0700</bug_when>
    <thetext>editing/pasteboard/dataTransfer-setData-getData.html failed not only hit ASSERT in KURL::KURL, but also other reason in implentation of dataTransfer.setData.

The reason of hit ASSERT in KURL::KURL was: A url did not inlude path, and scheme was file or http or https always be appended a slash in the end of url. In ClipboardWin::setData, we construct a url via KURL(ParsedURLString, data), if data was http://example.com, KURL parse this will hit ASSERT(url == m_string) since KURL append slash in the end of m_string, I suggest use KURL(KURL(), data) rather than KURL(ParsedURLString, data) in ClipboardWin::setData since we can not garantee web develop will call dataTransfer.setData with a canonicalized url such as &quot;http://www.example.com/&quot;;
In Addtion, this case seems did not expect append slash to canonicalize url, but [1] did not specify this;
[1] also did not specify how to parse &apos;\r\n&apos; in data, in Windows, we ues extractURL() to truncate the string after &apos;\n&apos;, which seems was inconsistent with author&apos;s expectation.

So, I prefer to use KURL(KURL(), data) instead of KURL(ParsedURLString, data) in ClipboardWin::setData() and modify the failure&apos;s reason in Skipped file to fix this bug.
Please feel free to comment it. Thanks.


1. http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html#datatransfer</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>