DocShell
Docshell Documentation
The goal of this page is to serve as a dumping/organization ground for docshell docs. When someone finds out something, it should be added here in a reasonable way. By the time this gets unwieldy, hopefully we will have enough material for several actual docs on what docshell does and why.
Table of Contents
Some of these sections need writing, and we may need other sections... Feel free to rearrange as needed
- About (What actually is docshell?)
- [#interfaces Interfaces]
- [#sh Session history] (needs work)
- [#uriload URI loading] (needs work)
- [#progress Progress notifications] (needs work)
- [#bugs Bugs] (needs work)
- [#plans Current Plans]
Interfaces Implemented by Docshell [#interfaces]
Docshell + webshell implement the following interfaces
Webshell:
- nsIWebShell LXR
- nsIWebShellContainer LXR
- nsIWebShellServices [<html><a href="http://lxr.mozilla.org/mozilla/source/webshell/public/nsIWebShellServices.h#52">LXR</a></html>]
- nsILinkHandler [<html><a href="http://lxr.mozilla.org/mozilla/source/webshell/public/nsILinkHandler.h#70">LXR</a></html>]
- nsIClipboardCommands (why?) [<html><a href="http://lxr.mozilla.org/mozilla/source/webshell/public/nsIClipboardCommands.idl#42">LXR</a></html>]
Docshell:
- nsIDocShell [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIDocShell.idl#68">LXR</a></html>]
- nsIDocShellTreeItem [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIDocShellTreeItem.idl#45">LXR</a></html>]
- nsIDocShellTreeNode [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIDocShellTreeNode.idl#44">LXR</a></html>]
- nsIDocShellHistory [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIDocShellHistory.idl#42">LXR</a></html>]
- nsIWebNavigation [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIWebNavigation.idl#42">LXR</a></html>]
- nsIBaseWindow [<html><a href="http://lxr.mozilla.org/mozilla/source/widget/public/nsIBaseWindow.idl#51">LXR</a></html>]
- nsIScrollable [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIScrollable.idl#42">LXR</a></html>]
- nsITextScroll [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsITextScroll.idl#43">LXR</a></html>]
- nsIDocCharset [<html><a href="http://lxr.mozilla.org/mozilla/source/intl/chardet/public/nsIDocCharset.idl#41">LXR</a></html>]
- nsIContentViewerContainer [<html><a href="http://lxr.mozilla.org/mozilla/source/webshell/public/nsIContentViewerContainer.idl#43">LXR</a></html>]
- nsIInterfaceRequestor [<html><a href="http://lxr.mozilla.org/mozilla/source/xpcom/base/nsIInterfaceRequestor.idl#42">LXR</a></html>]
- nsIScriptGlobalObjectOwner [<html><a href="http://lxr.mozilla.org/mozilla/source/dom/public/nsIScriptGlobalObjectOwner.h#50">LXR</a></html>]
- nsIRefreshURI [<html><a href="http://lxr.mozilla.org/mozilla/source/webshell/public/nsIRefreshURI.idl#43">LXR</a></html>]
- nsIWebProgressListener [<html><a href="http://lxr.mozilla.org/mozilla/source/uriloader/base/nsIWebProgressListener.idl#47">LXR</a></html>]
- nsIEditorDocShell [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIEditorDocShell.idl#45">LXR</a></html>]
- nsIWebPageDescriptor [<html><a href="http://lxr.mozilla.org/mozilla/source/docshell/base/nsIWebPageDescriptor.idl#38">LXR</a></html>]
In my view, nsIDocShellTree* and nsIWebShellContainer should all be merged into a single "tree node" interface. nsIWebShell should merge into nsIDocShell. nsILinkHandler, not sure. nsIContentViewerContainer and nsIScriptGlobalObjectOwner, do we really need those? nsIRefreshURI is probably something to merge into nsIDocShell (or even nsIWebNavigation?). nsIEditorDocshell also doesn't really need to be a separate interface.
Then again, do we want to just dump all sorts of stuff onto nsIDocShell? Not sure about that. Maybe we should look at who uses nsIDocShell and these other interfaces and why?
Bugs that could need some Docshell cleanup [#bugs]
- http://bugzilla.mozilla.org/show_bug.cgi?id=249751
- http://bugzilla.mozilla.org/show_bug.cgi?id=84833
Current plans for docshell [#plans]
nsDocLoaderImpl (nsDocLoader.cpp will be merged into nsDocShell; or rather, nsDocShell will become a subclass of nsDocLoaderImpl (no bug filed yet)
nsWebShell should be merged into nsDocShell
bug 261086 - docshell does not need quite as many things in its GetInterface implementation