diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 91fbda28f60cc7812a3beb8e69d7108e6027f6c7..b5b4eade0affa6a52c16b7d5f44e97418061689d 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2007-03-27 Oliver Hunt + + Reviewed by Adam. + + Test to ensure there is no delay forced when dragging a selected image + + * editing/pasteboard/drag-selected-image-to-contenteditable-expected.checksum: Added. + * editing/pasteboard/drag-selected-image-to-contenteditable-expected.png: Added. + * editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt: Added. + * editing/pasteboard/drag-selected-image-to-contenteditable.html: Added. + 2007-03-27 Anders Carlsson Reviewed by Geoff. diff --git a/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.checksum b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.checksum new file mode 100644 index 0000000000000000000000000000000000000000..0c151054aadb20235c05a3ecea17a7d7e5d48073 --- /dev/null +++ b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.checksum @@ -0,0 +1 @@ +ba69a37538c7912c7ef4932bf745da18 \ No newline at end of file diff --git a/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.png b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.png new file mode 100644 index 0000000000000000000000000000000000000000..1351ebc91ee1fa5bb66464926aa3558760a61bd4 Binary files /dev/null and b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.png differ diff --git a/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..a4be8e5e16fa88704ec5929236549f1934f5cd33 --- /dev/null +++ b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt @@ -0,0 +1,24 @@ +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionDropped +EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE +EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification +EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification +layer at (0,0) size 800x600 + RenderView at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderBlock {HTML} at (0,0) size 800x600 + RenderBody {BODY} at (0,0) size 800x584 + RenderBlock {DIV} at (0,0) size 302x122 [border: (1px solid #000000)] + RenderImage {IMG} at (1,1) size 76x103 + RenderBlock (anonymous) at (0,122) size 800x103 + RenderImage {IMG} at (0,0) size 76x103 + RenderText {#text} at (0,0) size 0x0 + RenderBlock {UL} at (0,241) size 800x18 + RenderListItem {LI} at (40,0) size 760x18 + RenderListMarker at (-17,0) size 7x18: bullet + RenderText {#text} at (0,0) size 409x18 + text run at (0,0) width 409: "Abe should appear twice, once inside the div and once outside it." +selection start: position 0 of child 0 {IMG} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document +selection end: position 1 of child 0 {IMG} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document diff --git a/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable.html b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable.html new file mode 100644 index 0000000000000000000000000000000000000000..1b784458ef3fc5f146252898f980486d26a1a4b7 --- /dev/null +++ b/LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable.html @@ -0,0 +1,61 @@ + + + + + + + + + + +
+ + + + diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 7632ad3dbc6f03dbb18613360926750e2bbdac07..56d41108b8ddc5d284b806494136a68d7ea5f9f0 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2007-03-27 Oliver Hunt + + Reviewed by Adam. + + Don't enforce text-selection drag delay when we are + going to drag an image anyway. + + Fixes rdar://problem/4668935 + + * page/EventHandler.cpp: + (WebCore::EventHandler::handleDrag): + 2007-03-27 Justin Garcia Build fix diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 2415f5c17866281f3f56120512ba5df8a853e76e..e67507c43e4450bbc25d88aaa655cca58edbc392 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -1431,7 +1431,7 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event) // For drags starting in the selection, the user must wait between the mousedown and mousedrag, // or else we bail on the dragging stuff and allow selection to occur - if (m_mouseDownMayStartDrag && dragState().m_dragSrcInSelection && event.event().timestamp() - m_mouseDownTimestamp < TextDragDelay) { + if (m_mouseDownMayStartDrag && !dragState().m_dragSrcIsImage && dragState().m_dragSrcInSelection && event.event().timestamp() - m_mouseDownTimestamp < TextDragDelay) { m_mouseDownMayStartDrag = false; dragState().m_dragSrc = 0; // ...but if this was the first click in the window, we don't even want to start selection