|
Lines 790-803
bool DragController::startDrag(Frame* sr
Source/WebCore/page/DragController.cpp_sec1
|
| 790 |
Image* image = getImage(element); |
790 |
Image* image = getImage(element); |
| 791 |
if (state.type == DragSourceActionSelection) { |
791 |
if (state.type == DragSourceActionSelection) { |
| 792 |
if (!clipboard->hasData()) { |
792 |
if (!clipboard->hasData()) { |
|
|
793 |
RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); |
| 794 |
ASSERT(selectionRange); |
| 795 |
|
| 796 |
src->editor().willWriteSelectionToPasteboard(selectionRange.get()); |
| 797 |
|
| 793 |
if (enclosingTextFormControl(src->selection()->start())) |
798 |
if (enclosingTextFormControl(src->selection()->start())) |
| 794 |
clipboard->writePlainText(src->editor().selectedTextForClipboard()); |
799 |
clipboard->writePlainText(src->editor().selectedTextForClipboard()); |
| 795 |
else { |
800 |
else |
| 796 |
RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); |
|
|
| 797 |
ASSERT(selectionRange); |
| 798 |
|
| 799 |
clipboard->writeRange(selectionRange.get(), src); |
801 |
clipboard->writeRange(selectionRange.get(), src); |
| 800 |
} |
802 |
|
|
|
803 |
src->editor().didWriteSelectionToPasteboard(); |
| 801 |
} |
804 |
} |
| 802 |
m_client->willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, clipboard); |
805 |
m_client->willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, clipboard); |
| 803 |
if (!dragImage) { |
806 |
if (!dragImage) { |