Diff
Modified: trunk/LayoutTests/ChangeLog (215847 => 215848)
--- trunk/LayoutTests/ChangeLog 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/LayoutTests/ChangeLog 2017-04-27 01:01:57 UTC (rev 215848)
@@ -1,14 +1,12 @@
2017-04-26 Tim Horton <[email protected]>
- Should not drag x-apple-data-detectors links
- https://bugs.webkit.org/show_bug.cgi?id=171352
- <rdar://problem/31309081>
+ Revert accidentally smushed commit.
- Reviewed by Beth Dakin.
+ * TestExpectations:
+ * fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt: Removed.
+ * fast/events/do-not-drag-and-drop-data-detectors-link.html: Removed.
+ * platform/mac/TestExpectations:
- * fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt: Added.
- * fast/events/do-not-drag-and-drop-data-detectors-link.html: Added.
-
2017-04-26 Matt Lewis <[email protected]>
Re-baseline inspector/dom/getAccessibilityPropertiesForNode.html after r215821
Modified: trunk/LayoutTests/TestExpectations (215847 => 215848)
--- trunk/LayoutTests/TestExpectations 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/LayoutTests/TestExpectations 2017-04-27 01:01:57 UTC (rev 215848)
@@ -106,9 +106,6 @@
# FKA focus ring only make sense on Mac
media/modern-media-controls/icon-button/icon-button-focus-state.html [ Skip ]
-# DataDetectors tests only make sense on Mac
-fast/events/do-not-drag-and-drop-data-detectors-link.html [ Skip ]
-
#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific tests.
#//////////////////////////////////////////////////////////////////////////////////////////
Deleted: trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt (215847 => 215848)
--- trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt 2017-04-27 01:01:57 UTC (rev 215848)
@@ -1,10 +0,0 @@
-This test checks that drag-and-drop is blocked for Data Detectors links.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Trying to drag Data Detectors link (should fail)
-
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link.html (215847 => 215848)
--- trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link.html 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/LayoutTests/fast/events/do-not-drag-and-drop-data-detectors-link.html 2017-04-27 01:01:57 UTC (rev 215848)
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-var ddLink;
-var didDragStart = false;
-
-window.jsTestIsAsync = true;
-
-window._onload_ = function ()
-{
- ddLink = document.getElementById("ddLink");
-
- ddLink._ondragstart_ = dragStart;
- document.body._onmouseup_ = mouseUp;
-
- runTests();
-}
-
-function dragStart(e)
-{
- didDragStart = true;
- debug('<br><span class="fail">FAIL! Got dragStart().</span>');
-}
-
-function mouseUp(e)
-{
- var testContainer = document.getElementById("test-container");
- if (testContainer)
- document.body.removeChild(testContainer);
- if (!didDragStart)
- debug('<br><span class="pass">TEST COMPLETE</span>');
- finishJSTest();
-}
-
-function dragAndDrop(beginX, beginY, endX, endY)
-{
- if (!window.eventSender)
- return;
- eventSender.mouseMoveTo(beginX, beginY);
- eventSender.mouseDown();
- eventSender.leapForward(100);
- eventSender.mouseMoveTo(endX, endY);
- eventSender.mouseUp();
-}
-
-function runTests()
-{
- if (!window.testRunner)
- return;
-
- debug("<br>Trying to drag Data Detectors link (should fail)<br>");
- dragAndDrop(ddLink.offsetLeft, ddLink.offsetTop + ddLink.offsetHeight / 2, 100, 100);
-}
-</script>
-</head>
-<body>
-<div id="description"></div>
-<div id="test-container">
- <a href="" id="ddLink">Data Detectors Link</a>
-</div>
-<div id="console"></div>
-<script>
-description("This test checks that drag-and-drop is blocked for Data Detectors links.");
-</script>
-</body>
-</html>
Modified: trunk/LayoutTests/platform/mac/TestExpectations (215847 => 215848)
--- trunk/LayoutTests/platform/mac/TestExpectations 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2017-04-27 01:01:57 UTC (rev 215848)
@@ -29,8 +29,6 @@
media/modern-media-controls/icon-button/icon-button-focus-state.html [ Pass ]
-fast/events/do-not-drag-and-drop-data-detectors-link.html [ Pass ]
-
#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific directories.
#//////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/Source/WebCore/ChangeLog (215847 => 215848)
--- trunk/Source/WebCore/ChangeLog 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/Source/WebCore/ChangeLog 2017-04-27 01:01:57 UTC (rev 215848)
@@ -1,23 +1,15 @@
2017-04-26 Tim Horton <[email protected]>
- Should not drag x-apple-data-detectors links
- https://bugs.webkit.org/show_bug.cgi?id=171352
- <rdar://problem/31309081>
+ Revert accidentally smushed commit.
- Reviewed by Beth Dakin.
-
- Test: fast/events/do-not-drag-and-drop-data-detectors-link.html
-
- These links are only meaningful in the context of the original document,
- so they should not be draggable.
-
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
- (WebCore::DataDetection::dataDetectorURLProtocol):
- (WebCore::DataDetection::isDataDetectorURL):
+ (WebCore::DataDetection::dataDetectorURLProtocol): Deleted.
+ (WebCore::DataDetection::isDataDetectorURL): Deleted.
* page/DragController.cpp:
(WebCore::isDraggableLink):
- Disallow dragging of <a href="" links.
+ * platform/mac/DragImageMac.mm:
+ (WebCore::createDragImageForLink):
2017-04-26 Alex Christensen <[email protected]>
Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.h (215847 => 215848)
--- trunk/Source/WebCore/editing/cocoa/DataDetection.h 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.h 2017-04-27 01:01:57 UTC (rev 215848)
@@ -39,7 +39,6 @@
class FloatRect;
class HitTestResult;
class Range;
-class URL;
enum DataDetectorTypes {
DataDetectorTypeNone = 0,
@@ -65,9 +64,6 @@
WEBCORE_EXPORT static bool shouldCancelDefaultAction(Element&);
WEBCORE_EXPORT static bool requiresExtendedContext(Element&);
#endif
-
- static const String& dataDetectorURLProtocol();
- static bool isDataDetectorURL(const URL&);
};
} // namespace WebCore
Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (215847 => 215848)
--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm 2017-04-27 01:01:57 UTC (rev 215848)
@@ -659,16 +659,4 @@
return nil;
}
#endif
-
-const String& DataDetection::dataDetectorURLProtocol()
-{
- static NeverDestroyed<String> protocol(ASCIILiteral("x-apple-data-detectors"));
- return protocol;
-}
-
-bool DataDetection::isDataDetectorURL(const URL& url)
-{
- return url.protocolIs(dataDetectorURLProtocol());
-}
-
} // namespace WebCore
Modified: trunk/Source/WebCore/page/DragController.cpp (215847 => 215848)
--- trunk/Source/WebCore/page/DragController.cpp 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/Source/WebCore/page/DragController.cpp 2017-04-27 01:01:57 UTC (rev 215848)
@@ -88,24 +88,12 @@
#include <wtf/RefPtr.h>
#endif
-#if PLATFORM(COCOA)
-#include "DataDetection.h"
-#endif
-
namespace WebCore {
bool isDraggableLink(const Element& element)
{
- if (is<HTMLAnchorElement>(element)) {
- auto& anchorElement = downcast<HTMLAnchorElement>(element);
- if (!anchorElement.isLiveLink())
- return false;
-#if PLATFORM(COCOA)
- return !DataDetection::isDataDetectorURL(anchorElement.href());
-#else
- return true;
-#endif
- }
+ if (is<HTMLAnchorElement>(element))
+ return downcast<HTMLAnchorElement>(element).isLiveLink();
if (is<SVGAElement>(element))
return element.isLink();
return false;
Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (215847 => 215848)
--- trunk/Source/WebCore/platform/mac/DragImageMac.mm 2017-04-27 00:53:23 UTC (rev 215847)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm 2017-04-27 01:01:57 UTC (rev 215848)
@@ -269,33 +269,8 @@
DragImageRef createDragImageForLink(Element&, URL& url, const String& title, TextIndicatorData&, FontRenderingMode, float)
{
- // FIXME: Soft link.
-
+ NSString *label = nsStringNilIfEmpty(title);
NSURL *cocoaURL = url;
-
- RetainPtr<LPLinkMetadata> metadata = adoptNS([[LPLinkMetadata alloc] init]);
- [metadata setOriginalURL:cocoaURL];
- [metadata setTitle:(NSString *)title];
-
- RetainPtr<LPLinkView> linkView = adoptNS([[LPLinkView alloc] initWithURL:cocoaURL]);
- [linkView setMetadata:metadata.get()];
-
- CGSize imageSize = [linkView sizeThatFits:CGSizeMake(400, 400)];
-
- [linkView setFrame:CGRectMake(0, 0, imageSize.width, imageSize.height)];
- [linkView layoutSubtreeIfNeeded];
-
- NSBitmapImageRep *rep = [linkView bitmapImageRepForCachingDisplayInRect:[linkView bounds]];
- [linkView cacheDisplayInRect:[linkView bounds] toBitmapImageRep:rep];
-
- NSImage *dragImage = [[[NSImage alloc] initWithSize:imageSize] autorelease];
- [dragImage addRepresentation:rep];
-
- return dragImage;
- // [dragImage lockFocus];
-
- /*NSString *label = nsStringNilIfEmpty(title);
- NSURL *cocoaURL = url;
NSString *urlString = [cocoaURL absoluteString];
BOOL drawURLString = YES;
@@ -368,7 +343,7 @@
drawDoubledAtPoint(label, NSMakePoint(DragLabelBorderX, imageSize.height - LabelBorderYOffset - [labelFont pointSize]), topColor, bottomColor, labelFont);
}
- [dragImage unlockFocus];*/
+ [dragImage unlockFocus];
return dragImage;
}