Document activation involves interactions between three distinct components.
A content viewer (nsIContentViewer interface) which is capable of processing
the given content type. The content viewer container (nsIContentViewerContainer
interface) which will host the particular nsIContentViewer instance.
And the document loader factory (nsIDocumentLoaderFactory interface) which
is used to instantiate the content viewer.
Document loaders may be nested depending on the structure of the document
which they represent. For example, if the document being loaded contains
an HTML frame set, then child document loaders will be created for each
frame.
The Document Loader performs the following steps during a document activation...
The WebShell encapsulates the underlying NGLayout subsystems and exposes
a collection of interfaces which allow developers to customize its behavior.
The WebShell itself is a chromeless window. However, in certain
circumstances it is necessary to access the outer chrome of the window
which contains the WebShell. For example, this type of access is
necessary for javascript manipulation of window chrome. This access is
accomplished via the nsIBrowserWindow interface which the WebShell will
occasionally call... The nsIBrowserWindow is an interface which abstractly
represents the top level window containing the outermost WebShell instance.
It is important to remember that while there may be many nested WebShells
representing a document only the outermost WebShell container supports
the nsIBrowserWindow interface. Below is a diagram which illustrates
the relationships between nested documents, WebShells and document loaders.
| Init |
Initialization function for a WebShell instance. This method
provides information needed by the WebShell to embed itself inside of a
native window provided by the caller. It is assumed that this function
will be called only once.
|
| Destroy |
Notify the WebShell that its parent's window is being destroyed.
After being destroyed, a WebShell is no longer visible and can no longer
display documents.
|
| GetBounds |
Return the current dimensions of the WebShell. |
| SetBounds |
Resize the WebShell to the given dimensions. |
| MoveTo |
|
| Show |
Make the WebShell visible. |
| Hide |
Make the WebShell invisible. |
| SetFocus |
Give the WebShell window focus. |
| RemoveFocus |
|
| Repaint |
Force the WebShell to repaint its window. |
| SetContentViewer |
Set the nsIContentViewer for the WebShell. |
| GetContentViewer |
Return the current nsIContentViewer embedded within the WebShell. |
| SetContainer |
Set the nsIWebShellContainer for the WebShell. |
| GetContainer |
Return the current nsIWebShellContainer. |
| SetObserver |
Set the nsIStreamObserver which receives all notifications from URLs
loaded by the document.
|
| GetObserver |
Return the current nsIStreamObserver. |
| SetPrefs |
Set the nsIPref used to get/set preference values... |
| GetPrefs |
Return the current nsIPref interface. |
| GetRootWebShell |
Return the root WebShell instance. Since WebShells can be nested
(when frames are present for example) this instance represents the outermost
WebShell.
|
| SetParent |
Set the parent WebShell. |
| GetParent |
Return the parent WebShell. |
| GetChildCount |
Return the current number of WebShells which are immediate children
of the current WebShell.
|
| AddChild |
Add a new child WebShell. |
| ChildAt |
Return the child WebShell at the requested index. |
| GetName |
Return the name of the current WebShell. |
| SetName |
Set the name of the current WebShell. |
| FindChildWithName |
Return the child WebShell with the specified name. |
| GetDocumentLoader |
Return the nsIDocumentLoader associated with the WebShell. |
| LoadURL |
Load the document associated with the specified URL into the WebShell. |
| Stop |
Stop loading the current document. |
| Reload |
Reload the current document. |
| CanBack |
Return whether the current WebShell can go back in its history list. |
| Back |
Load the previous document in the history list. |
| CanForward |
Return whether the current WebShell can go forward in its history list. |
| Forward |
Load the next document in the history list. |
| GoTo |
Load the document at the specified index in the history list. |
| GetHistoryIndex |
Return the current index in the history list. |
| GetURL |
Return the name of the URL at the specified history index. |
| GetTitle |
Return the title of the nsIBrowserWindow containing the WebShell. |
| SetTitle |
Set the title of the nsIBrowserWindow containing the WebShell. |
| GetMarginWidth |
|
| SetMarginWidth |
|
| GetMarginHeight |
|
| SetMarginHeight |
|
| Init |
|
| MoveTo |
Move the top level window to the specified location. |
| SizeTo |
Resize the top level window to the specified size. |
| GetBounds |
|
| GetWindowBounds |
|
| Show |
Show the top level window. |
| Hide |
Hide the top level window. |
| Close |
Close the top level window. |
| SetChrome |
Toggles the presence of various pieces of chrome on the top level window.
(i.e.. toolbar, status bar, ...)
|
| GetChrome |
Return the current chrome mask which describes which types of window
chrome are currently available.
|
| SetTitle |
Set the title of the top level window. |
| GetTitle |
Return the current title of the top level window. |
| SetStatus |
Set the status text for the top level window. |
| GetStatus |
Return the current status text... |
| SetProgress |
Set the progress bar on the top level window. |
| GetWebShell |
Return the outermost nsIWebShell which is contained in the top level
window.
|