New issue
Advanced search Search tips

Issue 849262 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

A download triggered while loading a local file cancels loading.

Project Member Reported by arthurso...@chromium.org, Jun 4 2018

Issue description

What steps will reproduce the problem?
(1) Navigate to index.html

Chrome:
  When the download starts, it cancels the parser of the loading document.
  It appears half loaded. 'PASS' is not displayed.

Firefox:
  The document is fully loaded. 'PASS' is displayed.

~~~ [index.html] ~~~
<html>
  <body>
    <p>
      <a href="./download.html" download>download link</a>
    </p>

    <script>
      document.querySelector('a').click();
    </script>

    <p> PASS </p>
  </body>
</html>
~~~

~~~ [download.html] ~~~
I am not an interesting file.
~~~


Note:
1) On Chrome, 'PASS' is not displayed only when the document is loaded from a local file.
2) The parser of the current document is canceled in FrameLoader::StartLoad().
 
eavHtG70gfp.png
37.3 KB View Download
test.zip
422 bytes Download
I can also reproduce using this python web server instead of a local file. It sends the response in several chunk and sleeps in between.
server.py
768 bytes View Download
Owner: yaoxia@chromium.org
Status: Assigned (was: Untriaged)
Loading triage:

+yaoxia@chromium.org who may know this area

I tried to reproduce this issue, but another problem starts hiding the reported case.
It seems the download attribute is completely ignored in this test case that does not have something special such as sandboxed iframe or so. The reported test case results in a navigation.
Hi toyoshim,

I think what you have found is also related to the original bug.

Currently, we ignore the download attr when the scheme is local (and do a navigation instead, which probably cancels the subsequent parsing), and the details can be found in this method (https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/weborigin/security_origin.cc?type=cs&sq=package:chromium&g=0&l=400). 

I'm not sure which behavior is correct though. If we definitely want Firefox's behavior, we might want to check with an expert on SecurityOrigin for the reason to disallow local scheme to read a content.
Status: Fixed (was: Assigned)
Aha, ignoring download for local file scheme sounds reasonable to me.

But the original bug have existed before you made that change, and the problem was parse was cancelled even if the clicked link was for a download.

I checked current behavior over a python http server. In this case, everything looks fine, download.html is downloaded, and parse is correctly finished and PASS is shown.

So, probably recent downloader change may have fixed the original issue.

I will close this as fixed. If the reporter still see the problem, please chime in.

Sign in to add a comment