On Chrome I have noticed that if I destroy an iframe before a request to submit a form inside it completes then the request is cancelled. This does not seem to happen in Firefox and IE.
Is this something which the spec recommends ? Do other browsers plan to do the same in future?
"Do other browsers plan to do the same in the future?"
No clue, but the chain of specification that I show below ultimately relies on the fetch specification, which was motivated in part by service workers, which are supported by Chrome and Firefox, "In Development" for MS Edge, and "Under Consideration" for WebKit (as of 2017-01-17).
WHATWG's
iframe
section states:WHATWG's browsers document's discard a
Document
section states:The same document's section on aborting a document states:
Given that the "fetch algorithm" is the new-ish standards-ized way in which a browser makes any HTTP request, I interpret the cancellation of any incomplete requests made by a removed
iframe
as consistent with the above sections.Cf. the fetch spec if you haven't had enough yet. :)
References again
The
iframe
elementDiscard a
Document
Abort a
Document
Fetch spec