XMLHttpRequest sometimes prevents pages from entering the back/forward cache.
<rdar://problem/55890340>
Created attachment 379958 [details] Patch
Comment on attachment 379958 [details] Patch r=me Isn't it also the case that the document refuses to cache if it has not fired the load event yet? It seems like tight coupling for an XHR object to maintain invariants on behalf of the document.
(In reply to Geoffrey Garen from comment #3) > Comment on attachment 379958 [details] > Patch > > r=me > > Isn't it also the case that the document refuses to cache if it has not > fired the load event yet? It seems like tight coupling for an XHR object to > maintain invariants on behalf of the document. It is true for the main frame but not necessarily true for subframes (that were added later on, after the load event had fired in the main frame).
> > Isn't it also the case that the document refuses to cache if it has not > > fired the load event yet? It seems like tight coupling for an XHR object to > > maintain invariants on behalf of the document. > > It is true for the main frame but not necessarily true for subframes (that > were added later on, after the load event had fired in the main frame). If a subframe has not loaded yet, and we cancel its loads in order to enter the page cache, doesn't that present the same concern -- that the subframe document will fire its load event while in the page cache?
(In reply to Geoffrey Garen from comment #5) > > > Isn't it also the case that the document refuses to cache if it has not > > > fired the load event yet? It seems like tight coupling for an XHR object to > > > maintain invariants on behalf of the document. > > > > It is true for the main frame but not necessarily true for subframes (that > > were added later on, after the load event had fired in the main frame). > > If a subframe has not loaded yet, and we cancel its loads in order to enter > the page cache, doesn't that present the same concern -- that the subframe > document will fire its load event while in the page cache? No, the load event would fire before entering PageCache, which is when we stop the loads. The issue here is that XMLHttpRequest stops its load in the "suspend" function (where script is not allowed to run). This can be refactored further so that XMLHttpRequest no longer stops its loads in suspend though. I can look into it in a follow-up.
Sounds good.
Comment on attachment 379958 [details] Patch Clearing flags on attachment: 379958 Committed r250678: <https://trac.webkit.org/changeset/250678>
All reviewed patches have been landed. Closing bug.