8000 add test for aborting a document load by anthumchris · Pull Request #9933 · web-platform-tests/wpt · GitHub
[go: up one dir, main page]

Skip to content

Conversation

anthumchris
Copy link
Member
@anthumchris anthumchris commented Mar 9, 2018

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

@ghost
Copy link
ghost commented Mar 9, 2018

Build BROKEN

Started: 2018-03-12 14:08:42
Finished: 2018-03-12 14:16:21

Failing Jobs

  • firefox:nightly
  • chrome:dev

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.
@gterzian
Copy link
Contributor
gterzian commented Jun 29, 2018

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 window.stop()).

"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

@wpt-pr-bot wpt-pr-bot requested review from zqzhang and removed request for hallvors, ronkorving, ayg and kangxu June 29, 2018 12:57
@anthumchris
Copy link
Member Author

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.

@gterzian
Copy link
Contributor
gterzian commented Jul 3, 2018

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 window.stop.

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 Esc or something similar, set a variable to true inside window.onabort and assert it is true after a timeout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0