Diff
Modified: branches/safari-603-branch/LayoutTests/ChangeLog (214179 => 214180)
--- branches/safari-603-branch/LayoutTests/ChangeLog 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/LayoutTests/ChangeLog 2017-03-20 18:40:37 UTC (rev 214180)
@@ -1,3 +1,20 @@
+2017-03-20 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-03-16 Jason Marcell <jmarc...@apple.com>
Merge r214059. rdar://problem/31099341
Added: branches/safari-603-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt (0 => 214180)
--- branches/safari-603-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt (rev 0)
+++ branches/safari-603-branch/LayoutTests/http/tests/download/anchor-download-no-value-expected.txt 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/LayoutTests/http/tests/download/anchor-download-no-value.html (0 => 214180)
--- branches/safari-603-branch/LayoutTests/http/tests/download/anchor-download-no-value.html (rev 0)
+++ branches/safari-603-branch/LayoutTests/http/tests/download/anchor-download-no-value.html 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations (214179 => 214180)
--- branches/safari-603-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/LayoutTests/platform/ios-simulator-wk1/TestExpectations 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations (214179 => 214180)
--- branches/safari-603-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/LayoutTests/platform/mac-wk1/TestExpectations (214179 => 214180)
--- branches/safari-603-branch/LayoutTests/platform/mac-wk1/TestExpectations 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/LayoutTests/platform/mac-wk1/TestExpectations 2017-03-20 18:40:37 UTC (rev 214180)
@@ -218,6 +218,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-branch/LayoutTests/platform/win/TestExpectations (214179 => 214180)
--- branches/safari-603-branch/LayoutTests/platform/win/TestExpectations 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/LayoutTests/platform/win/TestExpectations 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/Source/WebCore/ChangeLog (214179 => 214180)
--- branches/safari-603-branch/Source/WebCore/ChangeLog 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog 2017-03-20 18:40:37 UTC (rev 214180)
@@ -1,3 +1,23 @@
+2017-03-20 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-16 Jason Marcell <jmarc...@apple.com>
Merge r214059. rdar://problem/31099341
Modified: branches/safari-603-branch/Source/WebCore/loader/PolicyChecker.cpp (214179 => 214180)
--- branches/safari-603-branch/Source/WebCore/loader/PolicyChecker.cpp 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/Source/WebCore/loader/PolicyChecker.cpp 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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-branch/Source/WebKit2/ChangeLog (214179 => 214180)
--- branches/safari-603-branch/Source/WebKit2/ChangeLog 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog 2017-03-20 18:40:37 UTC (rev 214180)
@@ -1,3 +1,22 @@
+2017-03-20 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-03-16 Jason Marcell <jmarc...@apple.com>
Merge r212726. rdar://problem/30921822
Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp (214179 => 214180)
--- branches/safari-603-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp 2017-03-20 18:30:19 UTC (rev 214179)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp 2017-03-20 18:40:37 UTC (rev 214180)
@@ -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);