Title: [216250] trunk/Source/WebCore
- Revision
- 216250
- Author
- timothy_hor...@apple.com
- Date
- 2017-05-05 11:13:18 -0700 (Fri, 05 May 2017)
Log Message
Link drag images for apple.com front page links have a lot of spurious whitespace
https://bugs.webkit.org/show_bug.cgi?id=171719
<rdar://problem/32010854>
Reviewed by Wenson Hsieh.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Use the white-space-simplified string that we put on the pasteboard
for the drag image, too!
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (216249 => 216250)
--- trunk/Source/WebCore/ChangeLog 2017-05-05 18:11:46 UTC (rev 216249)
+++ trunk/Source/WebCore/ChangeLog 2017-05-05 18:13:18 UTC (rev 216250)
@@ -1,3 +1,16 @@
+2017-05-05 Tim Horton <timothy_hor...@apple.com>
+
+ Link drag images for apple.com front page links have a lot of spurious whitespace
+ https://bugs.webkit.org/show_bug.cgi?id=171719
+ <rdar://problem/32010854>
+
+ Reviewed by Wenson Hsieh.
+
+ * page/DragController.cpp:
+ (WebCore::DragController::startDrag):
+ Use the white-space-simplified string that we put on the pasteboard
+ for the drag image, too!
+
2017-05-04 Mark Lam <mark....@apple.com>
DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock.
Modified: trunk/Source/WebCore/page/DragController.cpp (216249 => 216250)
--- trunk/Source/WebCore/page/DragController.cpp 2017-05-05 18:11:46 UTC (rev 216249)
+++ trunk/Source/WebCore/page/DragController.cpp 2017-05-05 18:13:18 UTC (rev 216250)
@@ -1001,13 +1001,15 @@
if (!linkURL.isEmpty() && (m_dragSourceAction & DragSourceActionLink)) {
PasteboardWriterData pasteboardWriterData;
+ String textContentWithSimplifiedWhiteSpace = hitTestResult.textContent().simplifyWhiteSpace();
+
if (!dataTransfer.pasteboard().hasData()) {
// Simplify whitespace so the title put on the dataTransfer resembles what the user sees
// on the web page. This includes replacing newlines with spaces.
if (mustUseLegacyDragClient)
- src.editor().copyURL(linkURL, hitTestResult.textContent().simplifyWhiteSpace(), dataTransfer.pasteboard());
+ src.editor().copyURL(linkURL, textContentWithSimplifiedWhiteSpace, dataTransfer.pasteboard());
else
- pasteboardWriterData.setURL(src.editor().pasteboardWriterURL(linkURL, hitTestResult.textContent().simplifyWhiteSpace()));
+ pasteboardWriterData.setURL(src.editor().pasteboardWriterURL(linkURL, textContentWithSimplifiedWhiteSpace));
} else {
// Make sure the pasteboard also contains trustworthy link data
// but don't overwrite more general pasteboard types.
@@ -1031,7 +1033,7 @@
m_client.willPerformDragSourceAction(DragSourceActionLink, dragOrigin, dataTransfer);
if (!dragImage) {
TextIndicatorData textIndicator;
- dragImage = DragImage { createDragImageForLink(element, linkURL, hitTestResult.textContent(), textIndicator, src.settings().fontRenderingMode(), m_page.deviceScaleFactor()) };
+ dragImage = DragImage { createDragImageForLink(element, linkURL, textContentWithSimplifiedWhiteSpace, textIndicator, src.settings().fontRenderingMode(), m_page.deviceScaleFactor()) };
if (dragImage) {
IntSize size = dragImageSize(dragImage.get());
m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes