Skip to content

add test for aborting a document load - #9933

Open
anthumchris wants to merge 1 commit into
web-platform-tests:masterfrom
anthumchris:abort-document-load
Open

anthumchris wants to merge 1 commit into
web-platform-tests:masterfrom
anthumchris:abort-document-load

Conversation

@anthumchris

@anthumchris anthumchris commented Mar 9, 2018 •

Copy link
Copy Markdown
Member

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

ghost commented Mar 9, 2018 •

Copy link
Copy Markdown

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

gterzian commented Jun 29, 2018 •

Copy link
Copy Markdown
Contributor

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 ayg, hallvors, kangxu and ronkorving June 29, 2018 12:57
@anthumchris

Copy link
Copy Markdown
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

gterzian commented Jul 3, 2018 •

Copy link
Copy Markdown
Contributor

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?

@emilio
emilio removed their request for review August 21, 2026 15:51

This branch has not been deployed

No deployments
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