61
edits
Freesamael (talk | contribs) (Update IPC description) |
Freesamael (talk | contribs) (Add explanations of session history structure) |
||
| Line 11: | Line 11: | ||
== Browsers, Frames, and Document Navigation == | == Browsers, Frames, and Document Navigation == | ||
=== Docshell | === Docshell === | ||
The user of a Web browser can change the page shown in that browser in | The user of a Web browser can change the page shown in that browser in | ||
| Line 51: | Line 51: | ||
One of the most interfaces docshell implemented is <code>[https://dxr.mozilla.org/mozilla-central/source/docshell/base/nsIWebNavigation.idl nsIWebNavigation]</code>. It defines major functions of a browsing context, such as <code>loadURI</code> / <code>goBack</code> / <code>goForward</code> and <code>reload</code>. In single process configuration of desktop Firefox, <code><xul:browser></code> (which represents a tab) operates on docshell through <code>nsIWebNavigation</code>, as shown in the right figure. | One of the most interfaces docshell implemented is <code>[https://dxr.mozilla.org/mozilla-central/source/docshell/base/nsIWebNavigation.idl nsIWebNavigation]</code>. It defines major functions of a browsing context, such as <code>loadURI</code> / <code>goBack</code> / <code>goForward</code> and <code>reload</code>. In single process configuration of desktop Firefox, <code><xul:browser></code> (which represents a tab) operates on docshell through <code>nsIWebNavigation</code>, as shown in the right figure. | ||
* code: mozilla/docshell/ | * code: mozilla/docshell/ | ||
* bugzilla: Core::Document Navigation | * bugzilla: Core::Document Navigation | ||
* documentation: [[DocShell:Home Page]] | * documentation: [[DocShell:Home Page]] | ||
=== Session History === | |||
In order to keep the session history of subframes after the root document is unloaded and docshells of subframes are destroyed, only the root docshell of a docshell tree manages the session history (this does not match the conceptual model in the HTML5 spec and may be subject to change). | |||
As an example to explain the structure of session history implementation in Gecko, consider there's a tab A, which loads document 1; in document 1, there are iframe B & C, which loads document 2 & 3, respectively. Later, an user navigates iframe B to document 4. The following figures show the conceptual model of the example, and the corresponding session history structure. | |||
{| | |||
| [[File:BrowsingContextExample1.png|thumb|190px|Conceptual model representation; color denotes active documents]] | |||
| [[File:SHistoryExample1.png|thumb|180px|Session history structure; color denotes current transaction]] | |||
|} | |||
In Gecko, a [https://dxr.mozilla.org/mozilla-central/source/docshell/shistory/nsSHistory.h session history] object holds a list of [https://dxr.mozilla.org/mozilla-central/source/docshell/shistory/nsSHTransaction.h transactions] (denoted as T1 & T2 in the figure); each transaction points to a tree of [https://dxr.mozilla.org/mozilla-central/source/docshell/shistory/nsSHEntry.h entries]; each entry records the docshell it associated to, and a URL. Now that if we navigate the tab to a different root document 5, which includes an iframe D with document 6, then it becomes: | |||
{| | |||
| [[File:BrowsingContextExample2.png|thumb|275px|Conceptual model representation]] | |||
| [[File:SHistoryExample2.png|thumb|250px|Session history structure]] | |||
|} | |||
=== Embedding === | === Embedding === | ||
edits