-
Notifications
You must be signed in to change notification settings - Fork 3.5k
add test for aborting a document load #9933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add test for aborting a document load #9933
Conversation
Build BROKENStarted: 2018-03-12 14:08:42 Failing Jobs
View more information about this build on: |
Test for "abort" event firing on Window during a document load cancellation, triggered by ESC key, window.stop(), or browser stop button.
From reading the spec, I get the impression that the 'abort' event should only be fired in response to user interaction(not in response to every call to "User agents may allow users to explicitly invoke the abort a document algorithm for a Document. If the user does so, then, if that Document is an active document, the user agent should queue a task to fire an event named abort at that Document's Window object before invoking the abort algorithm."(https://html.spec.whatwg.org/multipage/browsing-the-web.html#aborting-a-document-load) Perhaps a manual test would be more appropriate for the 'abort' event, next to an automated test that would only assert the 'load' was indeed aborted? It is also worth noting that there is currently an empty "aborting-a-document-load" folder at https://github.com/web-platform-tests/wpt/tree/d2986bbab911ee78427ea063a453fc609f3e19be/html/browsers/browsing-the-web/aborting-a-document-load |
I'm open to any test that helps browser implementers ensure that some kind of event is fired. This is especially crucial to the Streams and Service Worker APIs and sending proper notifications upstream to applications. |
A maintainer might disagree with me, and as far as I can read from the spec, it seems that the abort event is only fired in response to explicit user interaction with the user agent(for example by pressing the Esc key), not when a script calls Also looking at the below, it's interesting to read that the 'abort' event should be fired before running the abort steps. "User agents may allow users to explicitly invoke the abort a document algorithm for a Document. If the user does so, then, if that Document is an active document, the user agent should queue a task to fire an event named abort at that Document's Window object before invoking the abort algorithm." Have you considered using a manual test that would only assert that 'abort' was fired, I guess by starting a slow load like you've done with the image(maybe rather start a XHR request via a 'start load' button on the page, and make it slow with the trickle option?), and then have the tester push |
Test for "abort" event firing on Window during a document load cancellation,
triggered by ESC key, window.stop(), or browser stop button.
whatwg/html#3525