Title: [212711] trunk/Source/WebCore
- Revision
- 212711
- Author
- [email protected]
- Date
- 2017-02-21 02:37:31 -0800 (Tue, 21 Feb 2017)
Log Message
REGRESSION(r212681): Crash when dragging links without a drag image
https://bugs.webkit.org/show_bug.cgi?id=168648
Reviewed by Tim Horton.
This happens in GTK+ port, because we don't use a drag image for links.
Fixes: editing/pasteboard/drop-link.html
editing/pasteboard/drop-text-without-selection.html
editing/pasteboard/files-during-page-drags.html
fast/events/content-changed-during-drop.html
fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
fast/events/drag-and-drop-link-into-focused-contenteditable.html
fast/events/drag-and-drop-link.html
fast/events/drag-in-frames.html
fast/events/drag-parent-node.html
fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
* page/DragController.cpp:
(WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
returns nullptr.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (212710 => 212711)
--- trunk/Source/WebCore/ChangeLog 2017-02-21 09:07:41 UTC (rev 212710)
+++ trunk/Source/WebCore/ChangeLog 2017-02-21 10:37:31 UTC (rev 212711)
@@ -1,3 +1,27 @@
+2017-02-21 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r212681): Crash when dragging links without a drag image
+ https://bugs.webkit.org/show_bug.cgi?id=168648
+
+ Reviewed by Tim Horton.
+
+ This happens in GTK+ port, because we don't use a drag image for links.
+
+ Fixes: editing/pasteboard/drop-link.html
+ editing/pasteboard/drop-text-without-selection.html
+ editing/pasteboard/files-during-page-drags.html
+ fast/events/content-changed-during-drop.html
+ fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
+ fast/events/drag-and-drop-link-into-focused-contenteditable.html
+ fast/events/drag-and-drop-link.html
+ fast/events/drag-in-frames.html
+ fast/events/drag-parent-node.html
+ fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
+
+ * page/DragController.cpp:
+ (WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
+ returns nullptr.
+
2017-02-21 Alex Christensen <[email protected]>
Unreviewed, rolling out r212699.
Modified: trunk/Source/WebCore/page/DragController.cpp (212710 => 212711)
--- trunk/Source/WebCore/page/DragController.cpp 2017-02-21 09:07:41 UTC (rev 212710)
+++ trunk/Source/WebCore/page/DragController.cpp 2017-02-21 10:37:31 UTC (rev 212711)
@@ -966,13 +966,15 @@
if (!dragImage) {
TextIndicatorData textIndicator;
dragImage = DragImage { createDragImageForLink(element, linkURL, hitTestResult.textContent(), textIndicator, src.settings().fontRenderingMode(), m_page.deviceScaleFactor()) };
- IntSize size = dragImageSize(dragImage.get());
- m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset);
- dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDraggedPoint.y() + m_dragOffset.y());
- dragImage = DragImage { platformAdjustDragImageForDeviceScaleFactor(dragImage.get(), m_page.deviceScaleFactor()) };
- if (textIndicator.contentImage)
- dragImage.setIndicatorData(textIndicator);
- dragImageAnchorPoint = FloatPoint { 0.5, static_cast<float>((size.height() - LinkDragBorderInset) / size.height()) };
+ if (dragImage) {
+ IntSize size = dragImageSize(dragImage.get());
+ m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset);
+ dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDraggedPoint.y() + m_dragOffset.y());
+ dragImage = DragImage { platformAdjustDragImageForDeviceScaleFactor(dragImage.get(), m_page.deviceScaleFactor()) };
+ if (textIndicator.contentImage)
+ dragImage.setIndicatorData(textIndicator);
+ dragImageAnchorPoint = FloatPoint { 0.5, static_cast<float>((size.height() - LinkDragBorderInset) / size.height()) };
+ }
}
if (mustUseLegacyDragClient) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes