Coder Social home page Coder Social logo

Comments (11)

hallvors avatar hallvors commented on May 22, 2024

#242 :)

from wpt.

Yaffle avatar Yaffle commented on May 22, 2024

@hallvors, thanks
but, may be i was wrong about this test:
http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#abort-a-document

Cancel any instances of the fetch algorithm in the context of this Document, discarding any tasks queued for
them, and discarding any further data received from the network for them

but, for "unloading" it is hardly to understand what spec says and
AND for XHR:

If the end user cancels the request
This is an abort error.

in any case "error" event should not be fired at xhr, seems, and Firefox is buggy here

see something similar for WebSockets: https://github.com/w3c/web-platform-tests/blob/master/websockets/unload-a-document/001-1.html

from wpt.

Yaffle avatar Yaffle commented on May 22, 2024

readyState before navigation/cancellation:

XMLHttpRequest LOADING
WebSocket (active) OPEN
EventSource (active) OPEN
EventSource (reconnecting) CONNECTING


"window.stop" OR page navigation OR navigation to a resources with Content-Disposition: attachment:

|                            | InternetExplorer 11 | FireFox 28           | Chrome 33          | Opera 12.16 |
|----------------------------|---------------------|----------------------|--------------------|-------------|
|XMLHttpRequest (active)     |                     |                      |                    |             |
|                events      | -                   | "error", "loadend"   | "abort", "loadend" | -           |
|                readyState  | LOADING             | DONE                 | DONE               | LOADING     |
|                active      | yes                 | no                   | no                 | yes         |
|----------------------------|---------------------|----------------------|--------------------|-------------|
|WebSocket (active)          |                     |                      |                    |             |
|                events      | N/A                 | "close" (code: 1001) | -                  | -           |
|                readyState  | OPEN                | CLOSED               | OPEN               | OPEN        |
|                active      | yes                 | no                   | yes                | yes         |
|----------------------------|---------------------|----------------------|--------------------|-------------|
|EventSource (active)        |                     |                      |                    |             |
|                events      | N/A                 | "error"              | -                  | -           |
|                readyState  | N/A                 | CLOSED               | CLOSED             | OPEN        |
|                active      | N/A                 | no                   | no                 | yes         |
|----------------------------|---------------------|----------------------|--------------------|-------------|
|EventSource (reconnecting)  |                     |                      |                    |             |
|                events      | N/A                 | -                    | -                  | -           |
|                readyState  | N/A                 | CONNECTING           | CONNECTING         | CONNECTING  |
|                active      | N/A                 | yes                  | yes                | yes         |

What about the rule for window.stop: if the fetching is cancelled, the browser must fire an event and change the readyState. ?

Firefox issues:

  1. "error" event type instead of "abort" for XMLHttpRequest - https://bugzilla.mozilla.org/show_bug.cgi?id=768596 - If user pressed the ESC button, XMLHttpRequest fires onerror instead of onabort.

Chrome issues:

  1. "error" is not fired at EventSource after window.stop usage
  2. "close" at WebSocket with code = 1001 - https://code.google.com/p/chromium/issues/detail?id=51687

Issues with Content-Disposition / <a download> and subframe navigation:

https://code.google.com/p/chromium/issues/detail?id=103238 - Requests cancelled after changing window location.
https://code.google.com/p/chromium/issues/detail?id=225654 - EventSource close event doesn't fire when computer put into sleep mode
https://code.google.com/p/chromium/issues/detail?id=153570 - EventSource is closed without notifications on a file download
https://code.google.com/p/chromium/issues/detail?id=260144 - B/f navigation stops ongoing XMLHttpRequests, even if only a subframe is navigated
https://bugzilla.mozilla.org/show_bug.cgi?id=564744 - XMLHttpRequest request cancelled (with status of 0 and no response text) if file downloading window pops up meanwhile
https://bugzilla.mozilla.org/show_bug.cgi?id=896666 - Need to not put EventSource and WebSocket into loadgroups or something

from wpt.

AFBarstow avatar AFBarstow commented on May 22, 2024

@jungkees @hallvors are these going to be added to your tests?

from wpt.

hallvors avatar hallvors commented on May 22, 2024

Didn't we already add the XHR-related tests in this issue? #242

from wpt.

Yaffle avatar Yaffle commented on May 22, 2024

@hallvors , yes , but #285 may also be useful

from wpt.

hallvors avatar hallvors commented on May 22, 2024

@Yaffle : I work only on the XHR part of this test suite, I think the pull request in #285 only affects eventsource tests. I don't know who is the "test facilitator" for event-source, but I'm sure @AFBarstow can help you nag the right person so that these pull requests can be handled! :-)

from wpt.

AFBarstow avatar AFBarstow commented on May 22, 2024

@hallvors the eventsource (aka Server-Sent Events) test facilitators are @zqzhang and @tinazhao

from wpt.

hallvors avatar hallvors commented on May 22, 2024

ping @zqzhang and @tinazhao - something to merge in here? :-)

from wpt.

zqzhang avatar zqzhang commented on May 22, 2024

@hallvors - nothing here. The eventsource test is in #285; and @Yaffle is expected to address the review comments there.

After #285 is merged, this one can be closed :)

from wpt.

hallvors avatar hallvors commented on May 22, 2024

@zqzhang Thanks for clarifying!

from wpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.