Title: [212930] trunk/Source/WebCore
- Revision
- 212930
- Author
- [email protected]
- Date
- 2017-02-23 15:38:06 -0800 (Thu, 23 Feb 2017)
Log Message
Data interaction with a URL should navigate the page if the operation is not handled
https://bugs.webkit.org/show_bug.cgi?id=168798
<rdar://problem/30665969>
Reviewed by Tim Horton.
Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::stringForType):
* platform/mac/DragDataMac.mm:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (212929 => 212930)
--- trunk/Source/WebCore/ChangeLog 2017-02-23 23:33:57 UTC (rev 212929)
+++ trunk/Source/WebCore/ChangeLog 2017-02-23 23:38:06 UTC (rev 212930)
@@ -1,3 +1,19 @@
+2017-02-23 Wenson Hsieh <[email protected]>
+
+ Data interaction with a URL should navigate the page if the operation is not handled
+ https://bugs.webkit.org/show_bug.cgi?id=168798
+ <rdar://problem/30665969>
+
+ Reviewed by Tim Horton.
+
+ Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
+
+ * page/DragController.cpp:
+ (WebCore::DragController::performDragOperation):
+ * platform/ios/PlatformPasteboardIOS.mm:
+ (WebCore::PlatformPasteboard::stringForType):
+ * platform/mac/DragDataMac.mm:
+
2017-02-23 Youenn Fablet <[email protected]>
[WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
Modified: trunk/Source/WebCore/page/DragController.cpp (212929 => 212930)
--- trunk/Source/WebCore/page/DragController.cpp 2017-02-23 23:33:57 UTC (rev 212929)
+++ trunk/Source/WebCore/page/DragController.cpp 2017-02-23 23:38:06 UTC (rev 212930)
@@ -253,8 +253,12 @@
if (operationForLoad(dragData) == DragOperationNone)
return false;
+ auto urlString = dragData.asURL();
+ if (urlString.isEmpty())
+ return false;
+
m_client.willPerformDragDestinationAction(DragDestinationActionLoad, dragData);
- m_page.mainFrame().loader().load(FrameLoadRequest(&m_page.mainFrame(), ResourceRequest(dragData.asURL()), shouldOpenExternalURLsPolicy));
+ m_page.mainFrame().loader().load(FrameLoadRequest(&m_page.mainFrame(), { urlString }, shouldOpenExternalURLsPolicy));
return true;
}
Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (212929 => 212930)
--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm 2017-02-23 23:33:57 UTC (rev 212929)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm 2017-02-23 23:38:06 UTC (rev 212930)
@@ -84,8 +84,16 @@
{
}
-String PlatformPasteboard::stringForType(const String&)
+String PlatformPasteboard::stringForType(const String& type)
{
+ NSArray *values = [m_pasteboard valuesForPasteboardType:type inItemSet:[NSIndexSet indexSetWithIndex:0]];
+ for (id value in values) {
+ if ([value isKindOfClass:[NSURL class]])
+ return [(NSURL *)value absoluteString];
+
+ if ([value isKindOfClass:[NSString class]])
+ return (NSString *)value;
+ }
return String();
}
Modified: trunk/Source/WebCore/platform/mac/DragDataMac.mm (212929 => 212930)
--- trunk/Source/WebCore/platform/mac/DragDataMac.mm 2017-02-23 23:33:57 UTC (rev 212929)
+++ trunk/Source/WebCore/platform/mac/DragDataMac.mm 2017-02-23 23:38:06 UTC (rev 212930)
@@ -220,11 +220,15 @@
return files.size() == 1;
}
+#if !ENABLE(DATA_INTERACTION)
+
bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
{
return !asURL(filenamePolicy).isEmpty();
}
+#endif
+
String DragData::asURL(FilenameConversionPolicy, String* title) const
{
// FIXME: Use filenamePolicy.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes