Do we have an object that represents the life of a document load from
the very beginning of deciding to load a URL in a browsing context to
the firing of the load event?

nsIChannel/nsIRequest is not it, because it only lasts until the end
of the network stream after which point there's still time to the
completion to the parse after which there is still time to the firing
of the load event. Also, the sort of object that I'm looking for would
stay the same over the course of several redirects that may happen
before the final URL is found.

nsIDocument is not it, because it's created after all the redirects
have been followed and OnStartRequest has been called on nsDocLoader
for each one. nsIContentViewer is not it for the same reason.

nsILoadGroup is not it, because it follows the lifetime of nsDocLoader.

The reason why I'm asking is that I've been trying to figure out
what's wrong with mIsLoadingDocument on nsDocLoader and so far, it
seems to me that it exists because it needs to span all the redirects
leading to the creation of the document object, so no flag on the
document itself will do and what's wrong with it is that nsDocLoader’s
lifetime may span multiple document loads, so it is the wrong object
for holding this flag. (In particular, a new document load can start
before the previous one has been cleanly finished and nsDocLoader also
posts restorations from the bfcache.)

-- 
Henri Sivonen
hsivo...@iki.fi
http://hsivonen.iki.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to