Commit 346107ea authored by oliver@apple.com's avatar oliver@apple.com

<rdar://problem/5537289> REGRESSION: Dragging a link or an image from an...

<rdar://problem/5537289> REGRESSION: Dragging a link or an image from an IFrame causes the page to not respond to clicks afterwards (15460)

Reviewed by John S.

EventHandler needs to reset these fields when a drag terminates, otherwise
EventHandler is left in an inconsistent state when a drag is initiated on a
page with multiple frames.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6778a7f1
...@@ -9,6 +9,22 @@ ...@@ -9,6 +9,22 @@
with a detail of 2 or higher comes in. This prevents the selection. with a detail of 2 or higher comes in. This prevents the selection.
* page/inspector/inspector.css: Mark the breadcrumb as user-select: none. * page/inspector/inspector.css: Mark the breadcrumb as user-select: none.
2007-11-12 Oliver Hunt <oliver@apple.com>
Reviewed by John S.
<rdar://problem/5537289> REGRESSION: Dragging a link or an image from an IFrame causes the page to not respond to clicks afterwards (15460)
EventHandler needs to reset these fields when a drag terminates, otherwise
EventHandler is left in an inconsistent state when a drag is initiated on a
page with multiple frames.
* page/EventHandler.cpp:
(WebCore::EventHandler::cancelDragAndDrop):
(WebCore::EventHandler::performDragAndDrop):
(WebCore::EventHandler::clearDragState):
* page/EventHandler.h:
2007-11-12 Oliver Hunt <oliver@apple.com> 2007-11-12 Oliver Hunt <oliver@apple.com>
Reviewed by Darin and Antti. Reviewed by Darin and Antti.
......
...@@ -1014,7 +1014,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi ...@@ -1014,7 +1014,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
bool swallowEvent = false; bool swallowEvent = false;
Node* targetNode = m_capturingMouseEventsNode ? m_capturingMouseEventsNode.get() : mev.targetNode(); Node* targetNode = m_capturingMouseEventsNode ? m_capturingMouseEventsNode.get() : mev.targetNode();
RefPtr<Frame> newSubframe = subframeForTargetNode(targetNode); RefPtr<Frame> newSubframe = subframeForTargetNode(targetNode);
// We want mouseouts to happen first, from the inside out. First send a move event to the last subframe so that it will fire mouseouts. // We want mouseouts to happen first, from the inside out. First send a move event to the last subframe so that it will fire mouseouts.
if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree()->isDescendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe) if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree()->isDescendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe)
passMouseMoveEventToSubframe(mev, m_lastMouseMoveEventSubframe.get()); passMouseMoveEventToSubframe(mev, m_lastMouseMoveEventSubframe.get());
...@@ -1177,7 +1177,7 @@ void EventHandler::cancelDragAndDrop(const PlatformMouseEvent& event, Clipboard* ...@@ -1177,7 +1177,7 @@ void EventHandler::cancelDragAndDrop(const PlatformMouseEvent& event, Clipboard*
else else
dispatchDragEvent(dragleaveEvent, m_dragTarget.get(), event, clipboard); dispatchDragEvent(dragleaveEvent, m_dragTarget.get(), event, clipboard);
} }
m_dragTarget = 0; clearDragState();
} }
bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard* clipboard) bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard* clipboard)
...@@ -1191,10 +1191,19 @@ bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard ...@@ -1191,10 +1191,19 @@ bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard
else else
accept = dispatchDragEvent(dropEvent, m_dragTarget.get(), event, clipboard); accept = dispatchDragEvent(dropEvent, m_dragTarget.get(), event, clipboard);
} }
m_dragTarget = 0; clearDragState();
return accept; return accept;
} }
void EventHandler::clearDragState()
{
m_dragTarget = 0;
m_capturingMouseEventsNode = 0;
#if PLATFORM(MAC)
m_sendingEventToSubview = false;
#endif
}
Node* EventHandler::nodeUnderMouse() const Node* EventHandler::nodeUnderMouse() const
{ {
return m_nodeUnderMouse.get(); return m_nodeUnderMouse.get();
......
...@@ -222,6 +222,7 @@ private: ...@@ -222,6 +222,7 @@ private:
bool handleDrag(const MouseEventWithHitTestResults&); bool handleDrag(const MouseEventWithHitTestResults&);
bool handleMouseUp(const MouseEventWithHitTestResults&); bool handleMouseUp(const MouseEventWithHitTestResults&);
void clearDragState();
bool dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent&); bool dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment