Summary: | Drag and drop issues after DOM modifications | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Berend-Jan Wever <skylined> | ||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED WORKSFORME | ||||||
Severity: | Critical | CC: | aegolden, oliver | ||||
Priority: | P1 | Keywords: | InRadar | ||||
Version: | 525.x (Safari 3.1) | ||||||
Hardware: | PC | ||||||
OS: | Windows Vista | ||||||
URL: | http://skypher.com/SkyLined/Repro/Safari/AVR%5B3c%5D@WebKit.dll+4c00%20%23bd95c6be/repro.html | ||||||
Attachments: |
|
Description
Berend-Jan Wever
2008-08-29 01:26:47 PDT
Created attachment 33498 [details]
Patch to use m_documentUnderMouse instead of element->ownerDocument() when element is NULL.
This patch prevents the crash by avoiding using a NULL result from elementFromPoint. I'm not sure if this is what we want or if we should, instead, prevent elementFromPoint from ever returning NULL in the first place.
Comment on attachment 33498 [details] Patch to use m_documentUnderMouse instead of element->ownerDocument() when element is NULL. This is basically a good patch but it needs a testcase, and i think there should be an assertion: > + if (element) { ASSERT(element->ownerDocument() == m_documentUnderMouse); > + innerFrame = element->ownerDocument()->frame(); > + } else > + innerFrame = m_documentUnderMouse->frame(); > + > ASSERT(innerFrame); > > if (dragData->containsColor()) { I can add the test case, but I'm confused by the assertion. If element->ownerDocument() == m_documentUnderMouse then it seems like we should just use m_documentUnderMouse and not even bother getting the element. Is that right? (In reply to comment #4) > I can add the test case, but I'm confused by the assertion. > > If element->ownerDocument() == m_documentUnderMouse then it seems like we > should just use m_documentUnderMouse and not even bother getting the element. > 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's actually the underlying problem. Seems to have been fixed at some point for it no longer reproduces. |