| 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 // coordinates to use high resolution image on high DPI screens. | 1132 // coordinates to use high resolution image on high DPI screens. |
| 1133 dragImage = dragImageForImage(element, image, screenDeviceScaleFactor, | 1133 dragImage = dragImageForImage(element, image, screenDeviceScaleFactor, |
| 1134 dragOrigin, imageRect.location(), | 1134 dragOrigin, imageRect.location(), |
| 1135 imageSizeInPixels, dragLocation); | 1135 imageSizeInPixels, dragLocation); |
| 1136 } | 1136 } |
| 1137 doSystemDrag(dragImage.get(), dragLocation, dragOrigin, dataTransfer, src, | 1137 doSystemDrag(dragImage.get(), dragLocation, dragOrigin, dataTransfer, src, |
| 1138 false); | 1138 false); |
| 1139 } else if (state.m_dragType == DragSourceActionLink) { | 1139 } else if (state.m_dragType == DragSourceActionLink) { |
| 1140 if (linkURL.isEmpty()) | 1140 if (linkURL.isEmpty()) |
| 1141 return false; | 1141 return false; |
| 1142 if (src->selection().isCaret() && src->selection().isContentEditable()) { | 1142 if (src->selection() |
| 1143 .computeVisibleSelectionInDOMTreeDeprecated() |
| 1144 .isCaret() && |
| 1145 src->selection().isContentEditable()) { |
| 1143 // a user can initiate a drag on a link without having any text | 1146 // a user can initiate a drag on a link without having any text |
| 1144 // selected. In this case, we should expand the selection to | 1147 // selected. In this case, we should expand the selection to |
| 1145 // the enclosing anchor element | 1148 // the enclosing anchor element |
| 1146 if (Node* node = enclosingAnchorElement(src->selection().base())) { | 1149 if (Node* node = enclosingAnchorElement(src->selection().base())) { |
| 1147 src->selection().setSelection( | 1150 src->selection().setSelection( |
| 1148 SelectionInDOMTree::Builder().selectAllChildren(*node).build()); | 1151 SelectionInDOMTree::Builder().selectAllChildren(*node).build()); |
| 1149 } | 1152 } |
| 1150 } | 1153 } |
| 1151 | 1154 |
| 1152 if (!dragImage) { | 1155 if (!dragImage) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1240 |
| 1238 DEFINE_TRACE(DragController) { | 1241 DEFINE_TRACE(DragController) { |
| 1239 visitor->trace(m_page); | 1242 visitor->trace(m_page); |
| 1240 visitor->trace(m_documentUnderMouse); | 1243 visitor->trace(m_documentUnderMouse); |
| 1241 visitor->trace(m_dragInitiator); | 1244 visitor->trace(m_dragInitiator); |
| 1242 visitor->trace(m_dragState); | 1245 visitor->trace(m_dragState); |
| 1243 visitor->trace(m_fileInputElementUnderMouse); | 1246 visitor->trace(m_fileInputElementUnderMouse); |
| 1244 } | 1247 } |
| 1245 | 1248 |
| 1246 } // namespace blink | 1249 } // namespace blink |
| OLD | NEW |