Skip to content
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

add test for aborting a document load #9933

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@AnthumChris
Copy link
Member

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

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots 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:

@AnthumChris AnthumChris force-pushed the AnthumChris:abort-document-load branch from 250ff4a to bbdcca0 Mar 9, 2018

add test for aborting a document load
Test for "abort" event firing on Window during a document load cancellation,
triggered by ESC key, window.stop(), or browser stop button.

@AnthumChris AnthumChris force-pushed the AnthumChris:abort-document-load branch from bbdcca0 to 6f3e541 Mar 12, 2018

@gterzian

This comment has been minimized.

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 removed request for hallvors, ronkorving and ayg Jun 29, 2018

@wpt-pr-bot wpt-pr-bot requested review from zqzhang and removed request for kangxu Jun 29, 2018

@AnthumChris

This comment has been minimized.

Copy link
Member Author

AnthumChris commented Jul 2, 2018

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

This comment has been minimized.

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
You can’t perform that action at this time.