From: rniwa@webkit.org Date: Tue, 24 Jan 2012 00:47:28 +0000 (+0000) Subject: REGRESSION(r105396): drag state is not cleared after each drag X-Git-Tag: 070512121124~14763 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d22c03e2204c8d19881bb64fd746d61a9873cc7d;p=profile%2Fivi%2Fwebkit-efl.git REGRESSION(r105396): drag state is not cleared after each drag https://bugs.webkit.org/show_bug.cgi?id=76878 Reviewed by Alexey Proskuryakov. Source/WebCore: Revert a part of r105396 that made performDragAndDrop not call clearDragState when the default action was not prevented since it caused a regression. I'm pretty certain always calling clearDragState in performDragAndDrop is wrong but I can't think of a test case where this becomes a problem at the moment. Since this area is not well tested, revert the change instead of making further changes to the code base. Tests: fast/events/clear-drag-state.html fast/events/clear-edit-drag-state.html * page/EventHandler.cpp: (WebCore::EventHandler::performDragAndDrop): LayoutTests: Add a regression test to ensure we don't fire extra dragenter event on the second drag at an element that contains the dragged content. * fast/events/clear-drag-state-expected.txt: Added. * fast/events/clear-drag-state.html: Added. * fast/events/clear-edit-drag-state-expected.txt: Added. * fast/events/clear-edit-drag-state.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105659 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 60ab781..bf6a169b 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,18 @@ +2012-01-23 Ryosuke Niwa + + REGRESSION(r105396): drag state is not cleared after each drag + https://bugs.webkit.org/show_bug.cgi?id=76878 + + Reviewed by Alexey Proskuryakov. + + Add a regression test to ensure we don't fire extra dragenter event + on the second drag at an element that contains the dragged content. + + * fast/events/clear-drag-state-expected.txt: Added. + * fast/events/clear-drag-state.html: Added. + * fast/events/clear-edit-drag-state-expected.txt: Added. + * fast/events/clear-edit-drag-state.html: Added. + 2012-01-23 Dale Curtis Reduce throttling on video-buffering-repaints-controls test to prevent timeout. diff --git a/LayoutTests/fast/events/clear-drag-state-expected.txt b/LayoutTests/fast/events/clear-drag-state-expected.txt new file mode 100644 index 0000000..e7f9264 --- /dev/null +++ b/LayoutTests/fast/events/clear-drag-state-expected.txt @@ -0,0 +1,4 @@ +This test ensures we clear the drag state at the end of each drag. To test manually, drag the green box below twice. You should observe the same list of events in the same order twice. + +Drag me down twice! +PASS diff --git a/LayoutTests/fast/events/clear-drag-state.html b/LayoutTests/fast/events/clear-drag-state.html new file mode 100644 index 0000000..5140a60 --- /dev/null +++ b/LayoutTests/fast/events/clear-drag-state.html @@ -0,0 +1,70 @@ + + + + + + +

This test ensures we clear the drag state at the end of each drag. To test manually, drag the green box below twice. +You should observe the same list of events in the same order twice.

+
+ Drag me down twice! +
+
+
+ + + diff --git a/LayoutTests/fast/events/clear-edit-drag-state-expected.txt b/LayoutTests/fast/events/clear-edit-drag-state-expected.txt new file mode 100644 index 0000000..e7f9264 --- /dev/null +++ b/LayoutTests/fast/events/clear-edit-drag-state-expected.txt @@ -0,0 +1,4 @@ +This test ensures we clear the drag state at the end of each drag. To test manually, drag the green box below twice. You should observe the same list of events in the same order twice. + +Drag me down twice! +PASS diff --git a/LayoutTests/fast/events/clear-edit-drag-state.html b/LayoutTests/fast/events/clear-edit-drag-state.html new file mode 100644 index 0000000..88551d2 --- /dev/null +++ b/LayoutTests/fast/events/clear-edit-drag-state.html @@ -0,0 +1,69 @@ + + + + + + +

This test ensures we clear the drag state at the end of each drag. To test manually, drag the green box below twice. +You should observe the same list of events in the same order twice.

+
+ Drag me down twice! +
+
+
+ + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index d404b2d..dc0cffa 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,24 @@ +2012-01-23 Ryosuke Niwa + + REGRESSION(r105396): drag state is not cleared after each drag + https://bugs.webkit.org/show_bug.cgi?id=76878 + + Reviewed by Alexey Proskuryakov. + + Revert a part of r105396 that made performDragAndDrop not call clearDragState + when the default action was not prevented since it caused a regression. + + I'm pretty certain always calling clearDragState in performDragAndDrop is wrong + but I can't think of a test case where this becomes a problem at the moment. + Since this area is not well tested, revert the change instead of making further + changes to the code base. + + Tests: fast/events/clear-drag-state.html + fast/events/clear-edit-drag-state.html + + * page/EventHandler.cpp: + (WebCore::EventHandler::performDragAndDrop): + 2012-01-23 Thiago Marcos P. Santos Fixed typo in exception messages diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index 1e85da0..507a914 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -1920,8 +1920,7 @@ bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard preventedDefault = targetFrame->eventHandler()->performDragAndDrop(event, clipboard); } else if (m_dragTarget.get()) preventedDefault = dispatchDragEvent(eventNames().dropEvent, m_dragTarget.get(), event, clipboard); - if (preventedDefault) - clearDragState(); + clearDragState(); return preventedDefault; }