Title: [213374] branches/safari-603.1.30.0-branch

Diff

Modified: branches/safari-603.1.30.0-branch/LayoutTests/ChangeLog (213373 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/ChangeLog	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/LayoutTests/ChangeLog	2017-03-03 19:36:58 UTC (rev 213374)
@@ -1,3 +1,20 @@
+2017-03-03  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r213253. rdar://problem/30773140
+
+    2017-03-01  Chris Dumez  <cdu...@apple.com>
+
+            [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
+            https://bugs.webkit.org/show_bug.cgi?id=169060
+            <rdar://problem/30773140>
+
+            Reviewed by Darin Adler.
+
+            Add layout test coverage.
+
+            * http/tests/download/anchor-download-no-value-expected.txt: Added.
+            * http/tests/download/anchor-download-no-value.html: Added.
+
 2017-02-27  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r212972. rdar://problem/30704432

Added: branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt (0 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt	                        (rev 0)
+++ branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt	2017-03-03 19:36:58 UTC (rev 213374)
@@ -0,0 +1,6 @@
+Download started.
+Downloading URL with suggested filename "abe.png"
+Download completed.
+The suggested filename above should be "abe.png" and the download should succeed.
+
+Link with download attribute.

Added: branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value.html (0 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value.html	                        (rev 0)
+++ branches/safari-603.1.30.0-branch/LayoutTests/http/tests/download/anchor-download-no-value.html	2017-03-03 19:36:58 UTC (rev 213374)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type='text/_javascript_'>
+if (window.testRunner) {
+  testRunner.dumpAsText();
+  testRunner.waitUntilDone();
+}
+</script>
+</head>
+<body>
+<p>The suggested filename above should be "abe.png" and the download should succeed.</p>
+<a id="download-url" href="" download>Link with download attribute.</a>
+<script>
+function click(elmt)
+{
+    if (!window.eventSender) {
+        alert('Click the link to run the test.');
+        return;
+    }
+    eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+
+function runTest()
+{
+    var link = document.getElementById("download-url");
+    click(link);
+}
+runTest();
+</script>
+</body>
+</html>

Modified: branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations (213373 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2017-03-03 19:36:58 UTC (rev 213374)
@@ -1347,6 +1347,7 @@
 webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ]
 webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
 webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
+webkit.org/b/156069 http/tests/download/anchor-download-no-value.html [ Skip ]
 
 # testRunner.setShouldDownloadUndisplayableMIMETypes() is not supported on WK1.
 fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html [ Skip ]

Modified: branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations (213373 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2017-03-03 19:36:58 UTC (rev 213374)
@@ -1845,6 +1845,7 @@
 webkit.org/b/156067 http/tests/security/anchor-download-allow-data.html [ Skip ]
 webkit.org/b/156067 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
 webkit.org/b/156067 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
+webkit.org/b/156067 http/tests/download/anchor-download-no-value.html [ Skip ]
 
 webkit.org/b/149087 http/tests/cache/disk-cache/disk-cache-vary.html [ Pass Timeout ]
 webkit.org/b/149087 http/tests/cache/disk-cache/disk-cache-vary-no-body.html [ Pass Timeout ]

Modified: branches/safari-603.1.30.0-branch/LayoutTests/platform/mac-wk1/TestExpectations (213373 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/platform/mac-wk1/TestExpectations	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/LayoutTests/platform/mac-wk1/TestExpectations	2017-03-03 19:36:58 UTC (rev 213374)
@@ -217,6 +217,7 @@
 webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ]
 webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
 webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
+webkit.org/b/156069 http/tests/download/anchor-download-no-value.html [ Skip ]
 
 # testRunner.setShouldDownloadUndisplayableMIMETypes() is not supported on WK1.
 fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html [ Skip ]

Modified: branches/safari-603.1.30.0-branch/LayoutTests/platform/win/TestExpectations (213373 => 213374)


--- branches/safari-603.1.30.0-branch/LayoutTests/platform/win/TestExpectations	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/LayoutTests/platform/win/TestExpectations	2017-03-03 19:36:58 UTC (rev 213374)
@@ -454,6 +454,7 @@
 http/tests/download/area-download.html [ Skip ]
 http/tests/security/anchor-download-allow-data.html [ Skip ]
 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
+http/tests/download/anchor-download-no-value.html [ Skip ]
 
 # testRunner.setShouldDownloadUndisplayableMIMETypes() is not supported on WK1.
 fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html [ Skip ]

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog (213373 => 213374)


--- branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog	2017-03-03 19:36:58 UTC (rev 213374)
@@ -1,3 +1,23 @@
+2017-03-03  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r213253. rdar://problem/30773140
+
+    2017-03-01  Chris Dumez  <cdu...@apple.com>
+
+            [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
+            https://bugs.webkit.org/show_bug.cgi?id=169060
+            <rdar://problem/30773140>
+
+            Reviewed by Darin Adler.
+
+            Make sure we never set the suggested filename to the empty string when
+            the download attribute is present but has no value.
+
+            Test: http/tests/download/anchor-download-no-value.html
+
+            * loader/PolicyChecker.cpp:
+            (WebCore::PolicyChecker::checkNavigationPolicy):
+
 2017-03-02  Matthew Hanson  <matthew_han...@apple.com>
 
         Rollout r212886. rdar://problem/30812601

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/loader/PolicyChecker.cpp (213373 => 213374)


--- branches/safari-603.1.30.0-branch/Source/WebCore/loader/PolicyChecker.cpp	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/loader/PolicyChecker.cpp	2017-03-03 19:36:58 UTC (rev 213374)
@@ -146,7 +146,7 @@
 #endif
 
     m_delegateIsDecidingNavigationPolicy = true;
-    m_suggestedFilename = action.downloadAttribute();
+    m_suggestedFilename = action.downloadAttribute().isEmpty() ? nullAtom : action.downloadAttribute();
     m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, formState, [this](PolicyAction action) {
         continueAfterNavigationPolicy(action);
     });

Modified: branches/safari-603.1.30.0-branch/Source/WebKit2/ChangeLog (213373 => 213374)


--- branches/safari-603.1.30.0-branch/Source/WebKit2/ChangeLog	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/Source/WebKit2/ChangeLog	2017-03-03 19:36:58 UTC (rev 213374)
@@ -1,3 +1,22 @@
+2017-03-03  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r213253. rdar://problem/30773140
+
+    2017-03-01  Chris Dumez  <cdu...@apple.com>
+
+            [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
+            https://bugs.webkit.org/show_bug.cgi?id=169060
+            <rdar://problem/30773140>
+
+            Reviewed by Darin Adler.
+
+            In the !NETWORK_SESSION code path, we were failing to use the suggested filename coming from the
+            network layer in the case where the download attribute is present but has no value. We were ending
+            up passing an empty string as suggested filename to Safari which is not handled properly.
+
+            * UIProcess/Downloads/DownloadProxy.cpp:
+            (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
+
 2017-02-27  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r213010. rdar://problem/30704432

Modified: branches/safari-603.1.30.0-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp (213373 => 213374)


--- branches/safari-603.1.30.0-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp	2017-03-03 18:59:51 UTC (rev 213373)
+++ branches/safari-603.1.30.0-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp	2017-03-03 19:36:58 UTC (rev 213374)
@@ -201,7 +201,7 @@
         return;
 
     String suggestedFilename = filename;
-    if (!m_suggestedFilename.isNull())
+    if (!m_suggestedFilename.isEmpty())
         suggestedFilename = m_suggestedFilename;
     
     destination = m_processPool->downloadClient().decideDestinationWithSuggestedFilename(m_processPool.get(), this, suggestedFilename, allowOverwrite);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to