<?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>20565</bug_id>
          
          <creation_ts>2008-08-29 01:26:47 -0700</creation_ts>
          <short_desc>Drag and drop issues after DOM modifications</short_desc>
          <delta_ts>2010-04-19 11:34:54 -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>New Bugs</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://skypher.com/SkyLined/Repro/Safari/AVR%5B3c%5D@WebKit.dll+4c00%20%23bd95c6be/repro.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Berend-Jan Wever">skylined</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aegolden</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89728</commentid>
    <comment_count>0</comment_count>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2008-08-29 01:26:47 -0700</bug_when>
    <thetext>The repro files for bug 20540 and bug 19516 no longer crash Safari with nightly when they are loaded but if either one of the repro&apos;s is drag-and-drop-ed into Safari twice, the second drag-and-drop causes a NULL pointer crash.

(f6c.df0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
WebKit!WebCore::DragController::concludeDrag+0x3a:
00000000`6d4a0cda 8b03            mov     eax,dword ptr [ebx]
ds:002b:00000000`00000000=????????</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133223</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-07-20 14:12:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/7075690&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134783</commentid>
    <comment_count>2</comment_count>
      <attachid>33498</attachid>
    <who name="Aaron Golden">aegolden</who>
    <bug_when>2009-07-25 16:42:16 -0700</bug_when>
    <thetext>Created attachment 33498
Patch to use m_documentUnderMouse instead of element-&gt;ownerDocument() when element is NULL.

This patch prevents the crash by avoiding using a NULL result from elementFromPoint.  I&apos;m not sure if this is what we want or if we should, instead, prevent elementFromPoint from ever returning NULL in the first place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135760</commentid>
    <comment_count>3</comment_count>
      <attachid>33498</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-07-29 18:04:40 -0700</bug_when>
    <thetext>Comment on attachment 33498
Patch to use m_documentUnderMouse instead of element-&gt;ownerDocument() when element is NULL.

This is basically a good patch but it needs a testcase, and i think there should be an assertion:
&gt; +    if (element) {
           ASSERT(element-&gt;ownerDocument() == m_documentUnderMouse);
&gt; +        innerFrame = element-&gt;ownerDocument()-&gt;frame();
&gt; +    } else
&gt; +        innerFrame = m_documentUnderMouse-&gt;frame();
&gt; +    
&gt;      ASSERT(innerFrame);
&gt;  
&gt;      if (dragData-&gt;containsColor()) {</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135776</commentid>
    <comment_count>4</comment_count>
    <who name="Aaron Golden">aegolden</who>
    <bug_when>2009-07-29 19:22:45 -0700</bug_when>
    <thetext>I can add the test case, but I&apos;m confused by the assertion.

If element-&gt;ownerDocument() == m_documentUnderMouse then it seems like we should just use m_documentUnderMouse and not even bother getting the element.  Is that right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>180564</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-01-13 23:13:20 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I can add the test case, but I&apos;m confused by the assertion.
&gt; 
&gt; If element-&gt;ownerDocument() == m_documentUnderMouse then it seems like we
&gt; should just use m_documentUnderMouse and not even bother getting the element. 
&gt; Is that right?

Actually i think that assertion would be incorrect, but likewise i think m_documentUnderMouse would be wrong, take the following:

1. I start to drag content over an element
2. page load occurs, resulting in a new document
3. i drop

now the issue will be the m_documentUnderMouse will be bogus, and i think that&apos;s actually the underlying problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>214128</commentid>
    <comment_count>6</comment_count>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2010-04-19 11:34:54 -0700</bug_when>
    <thetext>Seems to have been fixed at some point for it no longer reproduces.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>33498</attachid>
            <date>2009-07-25 16:42:16 -0700</date>
            <delta_ts>2009-07-29 18:04:40 -0700</delta_ts>
            <desc>Patch to use m_documentUnderMouse instead of element-&gt;ownerDocument() when element is NULL.</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1413</size>
            <attacher name="Aaron Golden">aegolden</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0NjQwMSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMDktMDctMjUgIEFhcm9uIEdvbGRlbiAgPGFnb2xkZW5AYXBwbGUu
Y29tPgorCis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m9tUG9pbnQocG9pbnQueCgpLCBwb2lu
dC55KCkpOwotICAgIEFTU0VSVChlbGVtZW50KTsKLSAgICBGcmFtZSogaW5uZXJGcmFtZSA9IGVs
ZW1lbnQtPm93bmVyRG9jdW1lbnQoKS0+ZnJhbWUoKTsKKyAgICBGcmFtZSogaW5uZXJGcmFtZSA9
IE5VTEw7CisgICAgaWYgKGVsZW1lbnQpCisgICAgICAgIGlubmVyRnJhbWUgPSBlbGVtZW50LT5v
d25lckRvY3VtZW50KCktPmZyYW1lKCk7CisgICAgZWxzZQorICAgICAgICBpbm5lckZyYW1lID0g
bV9kb2N1bWVudFVuZGVyTW91c2UtPmZyYW1lKCk7CisgICAgCiAgICAgQVNTRVJUKGlubmVyRnJh
bWUpOwogCiAgICAgaWYgKGRyYWdEYXRhLT5jb250YWluc0NvbG9yKCkpIHsK
</data>
<flag name="review"
          id="17766"
          type_id="1"
          status="-"
          setter="oliver"
    />
          </attachment>
      

    </bug>

</bugzilla>