Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 1860293003: Serialize original node when dragging a link instead of synthesizing HTML. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete delete Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/serializers/Serialization.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 } else if (state.m_dragType == DragSourceActionImage) { 747 } else if (state.m_dragType == DragSourceActionImage) {
748 if (imageURL.isEmpty() || !node || !node->isElementNode()) 748 if (imageURL.isEmpty() || !node || !node->isElementNode())
749 return false; 749 return false;
750 Element* element = toElement(node); 750 Element* element = toElement(node);
751 prepareDataTransferForImageDrag(src, dataTransfer, element, linkURL, ima geURL, hitTestResult.altDisplayString()); 751 prepareDataTransferForImageDrag(src, dataTransfer, element, linkURL, ima geURL, hitTestResult.altDisplayString());
752 } else if (state.m_dragType == DragSourceActionLink) { 752 } else if (state.m_dragType == DragSourceActionLink) {
753 if (linkURL.isEmpty()) 753 if (linkURL.isEmpty())
754 return false; 754 return false;
755 // Simplify whitespace so the title put on the clipboard resembles what the user sees 755 // Simplify whitespace so the title put on the clipboard resembles what the user sees
756 // on the web page. This includes replacing newlines with spaces. 756 // on the web page. This includes replacing newlines with spaces.
757 dataTransfer->writeURL(linkURL, hitTestResult.textContent().simplifyWhit eSpace()); 757 dataTransfer->writeURL(node, linkURL, hitTestResult.textContent().simpli fyWhiteSpace());
758 } 758 }
759 // FIXME: For DHTML/draggable element drags, write element markup to clipboa rd. 759 // FIXME: For DHTML/draggable element drags, write element markup to clipboa rd.
760 return true; 760 return true;
761 } 761 }
762 762
763 static IntPoint dragLocationForDHTMLDrag(const IntPoint& mouseDraggedPoint, cons t IntPoint& dragOrigin, const IntPoint& dragImageOffset, bool isLinkImage) 763 static IntPoint dragLocationForDHTMLDrag(const IntPoint& mouseDraggedPoint, cons t IntPoint& dragOrigin, const IntPoint& dragImageOffset, bool isLinkImage)
764 { 764 {
765 // dragImageOffset is the cursor position relative to the lower-left corner of the image. 765 // dragImageOffset is the cursor position relative to the lower-left corner of the image.
766 const int yOffset = -dragImageOffset.y(); 766 const int yOffset = -dragImageOffset.y();
767 767
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 981
982 DEFINE_TRACE(DragController) 982 DEFINE_TRACE(DragController)
983 { 983 {
984 visitor->trace(m_page); 984 visitor->trace(m_page);
985 visitor->trace(m_documentUnderMouse); 985 visitor->trace(m_documentUnderMouse);
986 visitor->trace(m_dragInitiator); 986 visitor->trace(m_dragInitiator);
987 visitor->trace(m_fileInputElementUnderMouse); 987 visitor->trace(m_fileInputElementUnderMouse);
988 } 988 }
989 989
990 } // namespace blink 990 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/serializers/Serialization.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698