Commit a9dbf87d authored by justing's avatar justing

LayoutTests:

        Reviewed by oliver
        
        <http://bugs.webkit.org/show_bug.cgi?id=12409>
        REGRESSION (r19039): Drag caret isn't cleared after a drop

        * editing/pasteboard/4947130-expected.checksum:
        * editing/pasteboard/4947130-expected.png:

WebCore:

        Reviewed by oliver
        
        <http://bugs.webkit.org/show_bug.cgi?id=12409>
        REGRESSION (r19039): Drag caret isn't cleared after a drop

        No new layout tests because the regression was
        caught by current layout tests.

        * page/DragController.cpp:
        (WebCore::DragController::concludeDrag): Clear the drag caret.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7cc9cd3f
2007-01-25 Justin Garcia <justin.garcia@apple.com>
Reviewed by oliver
<http://bugs.webkit.org/show_bug.cgi?id=12409>
REGRESSION (r19039): Drag caret isn't cleared after a drop
* editing/pasteboard/4947130-expected.checksum:
* editing/pasteboard/4947130-expected.png:
2007-01-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Geoffrey Garen.
7d64e7b27d11cc80d27631ba63c1d16a
\ No newline at end of file
41e551c1b3ce5530d2224bae09ce9e20
\ No newline at end of file
2007-01-25 Justin Garcia <justin.garcia@apple.com>
Reviewed by oliver
<http://bugs.webkit.org/show_bug.cgi?id=12409>
REGRESSION (r19039): Drag caret isn't cleared after a drop
No new layout tests because the regression was
caught by current layout tests.
* page/DragController.cpp:
(WebCore::DragController::concludeDrag): Clear the drag caret.
2007-01-25 Darin Adler <darin@apple.com>
Reviewed and landed by Geoffrey Garen.
......
......@@ -320,9 +320,10 @@ bool DragController::concludeDrag(DragData* dragData, DragDestinationAction acti
return false;
}
RefPtr<Range> range = m_page->dragCaretController()->toRange();
if (dragIsMove(innerFrame->selectionController(), dragData) || m_page->dragCaretController()->isContentRichlyEditable()) {
Selection dragCaret(m_page->dragCaretController()->selection());
m_page->dragCaretController()->clear();
RefPtr<Range> range = dragCaret.toRange();
if (dragIsMove(innerFrame->selectionController(), dragData) || dragCaret.isContentRichlyEditable()) {
bool chosePlainText = false;
RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, range, true, chosePlainText);
if (!fragment || !innerFrame->editor()->shouldInsertFragment(fragment, range, EditorInsertActionDropped))
......@@ -333,9 +334,9 @@ bool DragController::concludeDrag(DragData* dragData, DragDestinationAction acti
bool smartMove = innerFrame->selectionGranularity() == WordGranularity
&& innerFrame->editor()->smartInsertDeleteEnabled()
&& dragData->canSmartReplace();
applyCommand(new MoveSelectionCommand(fragment, innerFrame->dragCaretController()->base(), smartMove));
applyCommand(new MoveSelectionCommand(fragment, dragCaret.base(), smartMove));
} else {
innerFrame->selectionController()->setSelection(innerFrame->dragCaretController()->selection());
innerFrame->selectionController()->setSelection(dragCaret);
applyCommand(new ReplaceSelectionCommand(m_document, fragment, true, dragData->canSmartReplace(), chosePlainText));
}
} else {
......@@ -344,7 +345,7 @@ bool DragController::concludeDrag(DragData* dragData, DragDestinationAction acti
return false;
m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
innerFrame->selectionController()->setSelection(innerFrame->dragCaretController()->selection());
innerFrame->selectionController()->setSelection(dragCaret);
applyCommand(new ReplaceSelectionCommand(m_document, createFragmentFromText(range.get(), text), true, false, true));
}
......
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