| OLD | NEW |
| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 if (!clipboard->hasData()) | 816 if (!clipboard->hasData()) |
| 817 // Simplify whitespace so the title put on the clipboard resembles w
hat the user sees | 817 // Simplify whitespace so the title put on the clipboard resembles w
hat the user sees |
| 818 // on the web page. This includes replacing newlines with spaces. | 818 // on the web page. This includes replacing newlines with spaces. |
| 819 clipboard->writeURL(linkURL, hitTestResult.textContent().simplifyWhi
teSpace(), src); | 819 clipboard->writeURL(linkURL, hitTestResult.textContent().simplifyWhi
teSpace(), src); |
| 820 | 820 |
| 821 if (src->selection()->isCaret() && src->selection()->isContentEditable()
) { | 821 if (src->selection()->isCaret() && src->selection()->isContentEditable()
) { |
| 822 // a user can initiate a drag on a link without having any text | 822 // a user can initiate a drag on a link without having any text |
| 823 // selected. In this case, we should expand the selection to | 823 // selected. In this case, we should expand the selection to |
| 824 // the enclosing anchor element | 824 // the enclosing anchor element |
| 825 Position pos = src->selection()->base(); | 825 Position pos = src->selection()->base(); |
| 826 Handle<Node> node = adoptRawResult(enclosingAnchorElement(pos)); | 826 Handle<Node> node = enclosingAnchorElement(pos); |
| 827 if (node) | 827 if (node) |
| 828 src->selection()->setSelection(VisibleSelection::selectionFromCo
ntentsOfNode(node.raw())); | 828 src->selection()->setSelection(VisibleSelection::selectionFromCo
ntentsOfNode(node.raw())); |
| 829 } | 829 } |
| 830 | 830 |
| 831 m_client->willPerformDragSourceAction(DragSourceActionLink, dragOrigin,
clipboard); | 831 m_client->willPerformDragSourceAction(DragSourceActionLink, dragOrigin,
clipboard); |
| 832 if (!dragImage) { | 832 if (!dragImage) { |
| 833 dragImage = createDragImageForLink(linkURL, hitTestResult.textConten
t(), src); | 833 dragImage = createDragImageForLink(linkURL, hitTestResult.textConten
t(), src); |
| 834 IntSize size = dragImageSize(dragImage); | 834 IntSize size = dragImageSize(dragImage); |
| 835 m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset); | 835 m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset); |
| 836 dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDr
aggedPoint.y() + m_dragOffset.y()); | 836 dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDr
aggedPoint.y() + m_dragOffset.y()); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 #endif | 948 #endif |
| 949 return maxDragImageSize; | 949 return maxDragImageSize; |
| 950 } | 950 } |
| 951 | 951 |
| 952 void DragController::cleanupAfterSystemDrag() | 952 void DragController::cleanupAfterSystemDrag() |
| 953 { | 953 { |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace WebCore | 956 } // namespace WebCore |
| 957 | 957 |
| OLD | NEW |