Skip to content

[html] Add tests for window.stop - #11154

Open
jugglinmike wants to merge 1 commit into
web-platform-tests:masterfrom
bocoup:window-stop
Open

jugglinmike wants to merge 1 commit into
web-platform-tests:masterfrom
bocoup:window-stop

Conversation

@jugglinmike

@jugglinmike jugglinmike commented May 25, 2018 •

Copy link
Copy Markdown
Contributor

@annevk @foolip These tests show highly irregular behavior between Chrome, Edge, Firefox, and Safari:

sub-test Chrome 67 Edge 17 Firefox 61 Safari 11.1
cancels navigation that is not unloading FAIL PASS PASS FAIL
does not cancel navigation that is unloading PASS FAIL TIMEOUT PASS
aborts active fetches FAIL FAIL PASS PASS
aborts child browsing contexts PASS FAIL PASS PASS
aborts parsing PASS FAIL PASS PASS

Because of the amount of tomfoolery (it's tricky to verify that asynchronous operations don't occur), I expect there's something wrong with my methodology. I've included specification excerpts that I believe validate each test, but I could really use your input on whether or not they actually hold up.

If they do, I'll be happy to follow up with bug reports for Chrome and Firefox.

This is intended to resolve gh-11090

@jugglinmike
jugglinmike requested review from annevk and foolip May 25, 2018 01:56
@wpt-pr-bot
wpt-pr-bot requested review from jdm, jgraham and zqzhang May 25, 2018 01:56
@annevk

annevk commented May 25, 2018

Copy link
Copy Markdown
Member

This looks very hard to judge as it mixes a couple of aspects that we have a poor understanding and interoperability story for (javascript: URLs, window.stop(), document lifecycle). It's great to have tests, but I strongly suspect we need many more and a more concrete handle on what the overall model ought to be.

@jugglinmike
jugglinmike requested a review from zcorpan May 25, 2018 16:22
@jugglinmike

Copy link
Copy Markdown
Contributor Author

we need many more and a more concrete handle on what the overall model ought to be.

I'm game for both of these things.

For tests: would you like to see better coverage for javascript: URLs and data: URLs?

For the model: is it that things are under-specified? Or just not properly reflective of web reality?

@annevk

annevk commented May 28, 2018

Copy link
Copy Markdown
Member

@jugglinmike I think data: URLs are pretty solid these days (I wrote a large test suite for parsing them recently and their security model got figured out somewhere last year and tested). javascript: URLs could definitely use more coverage, though I recommend looking at open issues in whatwg/html and open PRs here first.

As far as the overall navigation/document lifecycle model goes, the issue is that things are under-specified, browsers are not interoperable with each other, and it's unclear what web reality is (there might be multiple realities due to browser sniffing or not caring about certain browsers, even). And on top of that there's a lot of things that influence that model one way or another.

@zcorpan

zcorpan commented May 30, 2018

Copy link
Copy Markdown
Member

So next step for this PR is to add a few more tests, avoiding javascript:, and see if the spec for stop() needs any changes to align with implementations. I don't think this needs to wait for navigation to be fully understood, although these tests may need updating as part of figuring out navigation.

@zcorpan

zcorpan commented May 31, 2018

Copy link
Copy Markdown
Member

FYI there are two tests with window.stop() currently:

$ grep -r "window\.stop" .
./eventsource/eventsource-request-cancellation.htm:          window.stop()
./xhr/abort-after-stop.htm:        window.stop();

also 2 more open PRs: #9973 #9933

@jugglinmike

Copy link
Copy Markdown
Contributor Author

The complexity of this patch is intended to avoid the race conditions present in gh-9933. I did try to avoid complexity, but I might be able to find something better if I take another look. I'm game to try to simplify as you suggested yesterday, Simon

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No tests for window.stop()

4 participants