whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.12k stars 2.67k forks source link

javascript URL: interaction with abort is not web-compatible #2590

Open bzbarsky opened 7 years ago

bzbarsky commented 7 years ago

Per spec, https://html.spec.whatwg.org/#navigate step 8 aborts all fetches, even when the navigation is to javascript:.

That's not web-compatible, last I checked. Certainly Gecko has an explicit "don't cancel fetches for javascript:" thing; they only get canceled if the javascript: in fact returns a string.

domenic commented 7 years ago

I believe this is a dupe of https://github.com/whatwg/html/issues/1896, which I tried to solve in https://github.com/whatwg/html/pull/1904 but got stuck on.

bzbarsky commented 7 years ago

No, this is not the same issue. This isn't about "when does the javascript: thing lead to a new document?". This is about "do fetches get canceled when a javascript: navigation does NOT lead to a new document?"

zcorpan commented 6 years ago

Test and analysis for this issue in https://github.com/w3c/web-platform-tests/pull/9501

zcorpan commented 6 years ago

So to be able to determine if fetches etc should be aborted, we need to reach step 12, substep If resource is a request whose url's scheme is "javascript"'s substep 12:

Process result: If Type(result) is not String, then set response to a response whose status is 204.

(which is in a task)

...before navigate's step 6.

Cancel any preexisting but not yet mature attempt to navigate browsingContext, including canceling any instances of the fetch algorithm started by those attempts. [...]

Right?

bzbarsky commented 6 years ago

What Gecko implements is that step 6 is skipped if the scheme is javascript:, iirc.