Title: [262649] trunk/Source/WebKit
Revision
262649
Author
achristen...@apple.com
Date
2020-06-05 13:15:51 -0700 (Fri, 05 Jun 2020)

Log Message

Fix PDF opening after r262592
https://bugs.webkit.org/show_bug.cgi?id=212795

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
(WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
As Darin mentioned and I was about to discover, my last-minute switching things around got the boolean condition backwards.
We want to do nothing if we're not allowed to open the PDF, and we want to open the PDF if we are allowed to.s

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (262648 => 262649)


--- trunk/Source/WebKit/ChangeLog	2020-06-05 20:15:08 UTC (rev 262648)
+++ trunk/Source/WebKit/ChangeLog	2020-06-05 20:15:51 UTC (rev 262649)
@@ -1,3 +1,14 @@
+2020-06-05  Alex Christensen  <achristen...@webkit.org>
+
+        Fix PDF opening after r262592
+        https://bugs.webkit.org/show_bug.cgi?id=212795
+
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
+        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
+        As Darin mentioned and I was about to discover, my last-minute switching things around got the boolean condition backwards.
+        We want to do nothing if we're not allowed to open the PDF, and we want to open the PDF if we are allowed to.s
+
 2020-06-05  David Kilzer  <ddkil...@apple.com>
 
         [IPC] Adopt enum class for PluginLoadClientPolicy

Modified: trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (262648 => 262649)


--- trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2020-06-05 20:15:08 UTC (rev 262648)
+++ trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2020-06-05 20:15:51 UTC (rev 262649)
@@ -512,7 +512,7 @@
     m_temporaryPDFFiles.add(pdfUUID, nsPath.get());
 
     m_uiClient->confirmPDFOpening(*this, WTFMove(frameInfo), [nsPath = WTFMove(nsPath)] (bool allowed) {
-        if (allowed)
+        if (!allowed)
             return;
         [[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:nsPath.get() isDirectory:NO]];
     });
@@ -528,7 +528,7 @@
         return;
 
     m_uiClient->confirmPDFOpening(*this, WTFMove(frameInfo), [pdfFilename = WTFMove(pdfFilename)] (bool allowed) {
-        if (allowed)
+        if (!allowed)
             return;
         [[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:pdfFilename isDirectory:NO]];
     });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to