From: dino@apple.com Date: Thu, 1 Nov 2018 01:03:09 +0000 (+0000) Subject: Forward original fragment identifier into System Preview X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=28fb1b25248664414cc7e28e699c26a476549ac9;ds=sidebyside Forward original fragment identifier into System Preview https://bugs.webkit.org/show_bug.cgi?id=191141 Reviewed by Wenson Hsieh. If the URL used by the page includes a fragment identifier, use it when telling QuickLook to open a local file. * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didFinish): Append original fragment identifier to the destination URL. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237664 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog index 76e5dd8..4b95cc9 100644 --- a/Source/WebKit/ChangeLog +++ b/Source/WebKit/ChangeLog @@ -1,3 +1,18 @@ +2018-10-31 Dean Jackson + + Forward original fragment identifier into System Preview + https://bugs.webkit.org/show_bug.cgi?id=191141 + + + Reviewed by Wenson Hsieh. + + If the URL used by the page includes a fragment identifier, use + it when telling QuickLook to open a local file. + + * UIProcess/Cocoa/DownloadClient.mm: + (WebKit::DownloadClient::didFinish): Append original fragment identifier + to the destination URL. + 2018-10-31 Zalan Bujtas [iOS] Do not paint tap highlight unless it is above a certain threshold diff --git a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm index 0084f56..c5a5d6b 100644 --- a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm +++ b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm @@ -212,8 +212,10 @@ void DownloadClient::didFinish(WebProcessPool&, DownloadProxy& downloadProxy) #if USE(SYSTEM_PREVIEW) if (downloadProxy.isSystemPreviewDownload()) { if (auto* webPage = downloadProxy.originatingPage()) { - NSURL *destinationURL = [NSURL fileURLWithPath:(NSString *)downloadProxy.destinationFilename()]; - webPage->systemPreviewController()->finish(WebCore::URL(destinationURL)); + WebCore::URL destinationURL = WebCore::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename()); + if (!destinationURL.fragmentIdentifier().length()) + destinationURL.setFragmentIdentifier(downloadProxy.request().url().fragmentIdentifier()); + webPage->systemPreviewController()->finish(destinationURL); } releaseActivityTokenIfNecessary(downloadProxy); return;