<?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>25050</bug_id>
          
          <creation_ts>2009-04-04 15:24:17 -0700</creation_ts>
          <short_desc>[Qt] Crash when dragging and dropping WebKit icon from firefox into editable Qt WebView</short_desc>
          <delta_ts>2009-04-05 10:26:48 -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 Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://www.webkit.org/</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="Erik L. Bunce">elbunce</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hausmann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116545</commentid>
    <comment_count>0</comment_count>
    <who name="Erik L. Bunce">elbunce</who>
    <bug_when>2009-04-04 15:24:17 -0700</bug_when>
    <thetext>I get a crash when dragging and dropping WebKit icon from firefox into editable Qt WebView.  This was with Qt WebKit from SVN trunk r42167.

Steps to reproduce (on Mac OS 10.5.6):
1) Bring up http:/www.webkit.org/ in Firefox 3.0.8.
2) Launch an app using Qt WebView 
3) Get an editable frame, for example, using QtLauncher, enable editing by checking &quot;Set Editable&quot; from the &quot;Edit&quot; menu
4) Start a drag of the WebKit icon from the top-left of the http://www.webkit.org page, and drop it into the editable QWebView.
5) Receive the following crash:

ASSERT: &quot;!isEmpty()&quot; in file /usr/local/Trolltech/Qt-4.5.0/lib/QtCore.framework/Versions/4/Headers/qlist.h, line 252

Program received signal SIGABRT, Aborted.
0x94e5ce42 in __kill ()
(gdb) bt
#0  0x94e5ce42 in __kill ()
#1  0x94e5ce34 in kill$UNIX2003 ()
#2  0x94ecf23a in raise ()
#3  0x94edb679 in abort ()
#4  0x0027b3b5 in qt_message_output ()
#5  0x0027b4a9 in qFatal ()
#6  0x0027b5b0 in qt_assert ()
#7  0x04836188 in QList&lt;QUrl&gt;::first (this=0xbfffdac4) at qlist.h:252
#8  0x04835a2f in WebCore::DragData::asURL (this=0xbfffde78, title=0x0) at ../../../WebCore/platform/qt/DragDataQt.cpp:129
#9  0x04835b76 in WebCore::DragData::asPlainText (this=0xbfffde78) at ../../../WebCore/platform/qt/DragDataQt.cpp:95
#10 0x04607a45 in documentFragmentFromDragData (dragData=0xbfffde78, context=@0xbfffdcb0, allowPlainText=true, chosePlainText=@0xbfffdc6b) at ../../../WebCore/page/DragController.cpp:123
#11 0x0460a371 in WebCore::DragController::concludeEditDrag (this=0x587ad0, dragData=0xbfffde78) at ../../../WebCore/page/DragController.cpp:396
#12 0x0460aee8 in WebCore::DragController::performDrag (this=0x587ad0, dragData=0xbfffde78) at ../../../WebCore/page/DragController.cpp:192
#13 0x0486365e in QWebPagePrivate::dropEvent (this=0x587560, ev=0xbfffe438) at ../../../WebKit/qt/Api/qwebpage.cpp:892
#14 0x0486aa71 in QWebPage::event (this=0x587250, ev=0xbfffe438) at ../../../WebKit/qt/Api/qwebpage.cpp:2070
#15 0x0486df12 in QWebView::dropEvent (this=0x570f60, ev=0xbfffe438) at ../../../WebKit/qt/Api/qwebview.cpp:850
#16 0x000141c5 in WebView::dropEvent (this=0x570f60, event=0xbfffe438) at HtmlEditMainWindow.cpp:180
#17 0x00b815ca in QWidget::event ()
#18 0x0486d88c in QWebView::event (this=0x570f60, e=0xbfffe438) at ../../../WebKit/qt/Api/qwebview.cpp:589
#19 0x00b3538f in QApplicationPrivate::notify_helper ()
#20 0x00b3c629 in QApplication::notify ()
#21 0x00374ab2 in QCoreApplication::notifyInternal ()
#22 0x00ac3c9a in QWidgetPrivate::qt_mac_dnd_event ()
#23 0x00ad8756 in QWidgetPrivate::qt_widget_event ()
#24 0x93049143 in DispatchEventToHandlers ()
#25 0x9304857d in SendEventToEventTargetInternal ()
#26 0x930483e2 in SendEventToEventTargetWithOptions ()
#27 0x931cf520 in SendControlDefDragReceive ()
#28 0x931cf422 in ControlDragReceiveHandler ()
#29 0x931cf397 in CarbonReceiveMapper ()
#30 0x94d421b0 in DoDropMessage ()
#31 0x94d41c11 in CoreDragMessageHandler ()
#32 0x93fe8d21 in __CFMessagePortPerform ()
#33 0x9400a8e8 in CFRunLoopRunSpecific ()
#34 0x9400acd8 in CFRunLoopRunInMode ()
#35 0x00ade0b0 in QEventDispatcherMac::processEvents ()
#36 0x00374061 in QEventLoop::processEvents ()
#37 0x0037420d in QEventLoop::exec ()
#38 0x0037806e in QCoreApplication::exec ()
#39 0x000146e3 in main (argc=1, argv=0xbffff49c) at main.cpp:68
(gdb) 

For some reason the platform drag data returns an empty list of urls, which DragData::asUrl() is attempting to return the first() entry of without checking that it exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116551</commentid>
    <comment_count>1</comment_count>
      <attachid>29260</attachid>
    <who name="Erik L. Bunce">elbunce</who>
    <bug_when>2009-04-04 20:45:37 -0700</bug_when>
    <thetext>Created attachment 29260
Fix an assert failure when dropping an &apos;empty&apos; text/uri-list on a QWebView.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116573</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-04-05 10:26:48 -0700</bug_when>
    <thetext>Thanks! landed in r42234</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>29260</attachid>
            <date>2009-04-04 20:45:37 -0700</date>
            <delta_ts>2009-04-05 10:26:19 -0700</delta_ts>
            <desc>Fix an assert failure when dropping an &apos;empty&apos; text/uri-list on a QWebView.</desc>
            <filename>dragdrop_assert_fix.patch</filename>
            <type>text/plain</type>
            <size>1318</size>
            <attacher name="Erik L. Bunce">elbunce</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0MjIyOSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTIgQEAKKzIwMDktMDQtMDQgIEVyaWsgTC4gQnVuY2UgIDxlbGJ1bmNlQHhlbmRv
bS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAg
Rml4IGFuIGFzc2VydCBmYWlsdXJlIHdoZW4gZHJvcHBpbmcgYW4gJ2VtcHR5JyB0ZXh0L3VyaS1s
aXN0IG9uIGEgUVdlYlZpZXcuIAorCisgICAgICAgICogcGxhdGZvcm0vcXQvRHJhZ0RhdGFRdC5j
cHA6CisgICAgICAgIChXZWJDb3JlOjpEcmFnRGF0YTo6YXNVUkwpOgorCiAyMDA5LTA0LTA0ICBT
aW1vbiBGcmFzZXIgIDxzaW1vbi5mcmFzZXJAYXBwbGUuY29tPgogCiAgICAgICAgIFJldmlld2Vk
IGJ5IENhbWVyb24gWndhcmljaApJbmRleDogV2ViQ29yZS9wbGF0Zm9ybS9xdC9EcmFnRGF0YVF0
LmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09Ci0tLSBXZWJDb3JlL3BsYXRmb3JtL3F0L0RyYWdEYXRhUXQuY3BwCShy
ZXZpc2lvbiA0MjE2NykKKysrIFdlYkNvcmUvcGxhdGZvcm0vcXQvRHJhZ0RhdGFRdC5jcHAJKHdv
cmtpbmcgY29weSkKQEAgLTEsNSArMSw1IEBACiAvKgotICogQ29weXJpZ2h0IChDKSAyMDA3LCAy
MDA4IEFwcGxlIEluYy4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqIENvcHlyaWdodCAoQykgMjAw
NywgMjAwOCwgMjAwOSBBcHBsZSBJbmMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVk
aXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3
aXRob3V0CiAgKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUg
Zm9sbG93aW5nIGNvbmRpdGlvbnMKQEAgLTEyNiw2ICsxMjYsMTAgQEAgU3RyaW5nIERyYWdEYXRh
Ojphc1VSTChTdHJpbmcqIHRpdGxlKSBjbwogICAgIGlmICghbV9wbGF0Zm9ybURyYWdEYXRhKQog
ICAgICAgICByZXR1cm4gU3RyaW5nKCk7CiAgICAgUUxpc3Q8UVVybD4gdXJscyA9IG1fcGxhdGZv
cm1EcmFnRGF0YS0+dXJscygpOworCisgICAgaWYgKHVybHMuaXNFbXB0eSgpKQorICAgICAgICBy
ZXR1cm4gU3RyaW5nKCk7CisKICAgICByZXR1cm4gdXJscy5maXJzdCgpLnRvU3RyaW5nKCk7CiB9
CiAgICAgCg==
</data>
<flag name="review"
          id="14524"
          type_id="1"
          status="+"
          setter="hausmann"
    />
          </attachment>
      

    </bug>

</bugzilla>