Skip to content

Commit 0352eed

Browse files
committed
Splitting current/rendered history entries
1 parent f0c5ed8 commit 0352eed

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

source

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77508,6 +77508,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7750877508
<p>A <span>browsing session</span> has a <def data-x="bs-script-visible-history-length">script-visible history length</def>, a nonnegative integer. JAKE-TODO: hook up the above</p>
7750977509

7751077510
<p class="note">This provides synchronous access to <code data-x="dom-history-length">history.length</code>.</p>
77511+
77512+
JAKE-TODO: I'm not sure this is right for synchronous access. I think it needs to go elsewhere
7751177513
</li>
7751277514

7751377515
<li>
@@ -82697,21 +82699,27 @@ interface <dfn>BarProp</dfn> {
8269782699

8269882700
<h4>Navigables</h4>
8269982701

82700-
<p>A <dfn export>navigable</dfn> presents a <code>Document</code> to the user via its <span data-x="nav-current-history-entry">current session history entry</span>. It has:</p>
82702+
<p>A <dfn export>navigable</dfn> presents a <code>Document</code> to the user via its <span data-x="nav-displayed-history-entry">displayed session history entry</span>. It has:</p>
8270182703

8270282704
<ul>
8270382705
<li><p>An <dfn data-x="nav-id">id</dfn>, a <span>new unique internal value</span>.</p></li>
8270482706

8270582707
<li><p>A <dfn data-x="nav-parent">parent</dfn>, a <span>navigable</span> or null. JAKE-TODO: make sure this is set in all contructions points.</p></li>
8270682708

8270782709
<li><p>A <dfn data-x="nav-current-history-entry">current session history entry</dfn>, a <span>session history entry</span>. This must be an <span data-x="list item">item</span> in this <span>navigable</span>'s <span data-x="nav-session-history-entries">session history entries</span>.</p></li>
82710+
82711+
<li>
82712+
<p>A <dfn data-x="nav-displayed-history-entry">displayed session history entry</dfn>, a <span>session history entry</span>. This must be an <span data-x="list item">item</span> in this <span>navigable</span>'s <span data-x="nav-session-history-entries">session history entries</span>.</p>
82713+
82714+
<p class="note">This is usually the same as the <span data-x="nav-current-history-entry">current session history entry</span>, except in cases where the <span data-x="nav-current-history-entry">current session history entry</span> cannot be displayed. JAKE-TODO: Link this up to the step where it happens.</p>
82715+
</li>
8270882716
</ul>
8270982717

82710-
<p>A <span>navigable</span>'s <dfn data-x="nav-bc">current browsing context</dfn> is its <span data-x="nav-current-history-entry">current session history entry</span>'s <span data-x="she-bc">browsing context</span>.</p>
82718+
<p>A <span>navigable</span>'s <dfn data-x="nav-bc">current browsing context</dfn> is its <span data-x="nav-displayed-history-entry">displayed session history entry</span>'s <span data-x="she-bc">browsing context</span>.</p>
8271182719

82712-
<p>A <span>navigable</span>'s <dfn data-x="nav-url">current URL</dfn> is its <span data-x="nav-current-history-entry">current session history entry</span>'s <span data-x="she-url">URL</span>.</p>
82720+
<p>A <span>navigable</span>'s <dfn data-x="nav-url">current URL</dfn> is its <span data-x="nav-displayed-history-entry">displayed session history entry</span>'s <span data-x="she-url">URL</span>.</p>
8271382721

82714-
<p>A <span>navigable</span>'s <dfn data-x="nav-document">current document</dfn> is its <span data-x="nav-current-history-entry">current session history entry</span>'s <span data-x="she-document">document</span>.</p>
82722+
<p>A <span>navigable</span>'s <dfn data-x="nav-document">current document</dfn> is its <span data-x="nav-displayed-history-entry">displayed session history entry</span>'s <span data-x="she-document">document</span>.</p>
8271582723

8271682724
<p>To get a the <dfn data-x="nav-top" export>top-level navigable</dfn> of a <span>navigable</span> <var>inputNavigable</var>, run these steps:</p>
8271782725

@@ -82737,7 +82745,7 @@ interface <dfn>BarProp</dfn> {
8273782745
<li><p>Let <var>navigable</var> be a new <dfn>navigable</dfn>.</p></li>
8273882746

8273982747
<li>
82740-
<p>Set <var>navigable</var>'s <span data-x="nav-current-history-entry">current session history entry</span> to a new <span>session history entry</span>, with the following:</p>
82748+
<p>Let <var>entry</var> be a new <span>session history entry</span>, with the following:</p>
8274182749
<dl>
8274282750
<dt><span data-x="she-url">URL</span></dt>
8274382751
<dd><var>document</var>'s <span data-x="concept-document-url">URL</span></dd>
@@ -82746,6 +82754,10 @@ interface <dfn>BarProp</dfn> {
8274682754
</dl>
8274782755
</li>
8274882756

82757+
<li><p>Set <var>navigable</var>'s <span data-x="nav-current-history-entry">current session history entry</span> to <var>entry</var>.</p></li>
82758+
82759+
<li><p>Set <var>navigable</var>'s <span data-x="nav-displayed-history-entry">displayed session history entry</span> to <var>entry</var>.</p></li>
82760+
8274982761
<li><p>Return <var>navigable</var>.</p></li>
8275082762
</ol>
8275182763

@@ -82777,7 +82789,7 @@ interface <dfn>BarProp</dfn> {
8277782789

8277882790
<h5>Traversable navigables</h5>
8277982791

82780-
<p>A <dfn export>traversable navigable</dfn> is a <span>navigable</span> that also controls which <span>session history entry</span> should be the <span data-x="nav-current-history-entry">current session history entry</span> for itself and its descendant <span data-x="navigable">navigables</span>.</p>
82792+
<p>A <dfn export>traversable navigable</dfn> is a <span>navigable</span> that also controls which <span>session history entry</span> should be the <span data-x="nav-current-history-entry">current session history entry</span> and <span data-x="nav-displayed-history-entry">displayed session history entry</span> for itself and its descendant <span data-x="navigable">navigables</span>.</p>
8278182793

8278282794
<p>In addition to the properties of a <span>navigable</span>, a <span>traversable navigable</span> has:</p>
8278382795

@@ -82834,13 +82846,13 @@ interface <dfn>BarProp</dfn> {
8283482846

8283582847
<li><p>Let <var>step</var> be the <var>navigable</var>'s <span data-x="tn-current-session-history-step">current session history step</span>.</p></li>
8283682848

82837-
<li><p>Let <var>entryLists</var> be the <span data-x="set">ordered set</span> « <var>navigable</var>'s <span data-x="tn-session-history-entries">session history entries</span> »</p></li>
82849+
<li><p>Let <var>entryLists</var> be the <span data-x="set">ordered set</span> « <var>navigable</var>'s <span data-x="tn-session-history-entries">session history entries</span> ».</p></li>
8283882850

8283982851
<li>
8284082852
<p><span data-x="list iterate">For each</span> <var>entryList</var> of <var>entryLists</var>:</p>
8284182853

8284282854
<ol>
82843-
<li><p><span data-x="list remove">Remove</span> every <span>session history entry</span> from <var>entryList</var> with a <span data-x="she-step">step</span> greater than <var>step</var>.</p></li>
82855+
<li><p><span data-x="list remove">Remove</span> every <span>session history entry</span> from <var>entryList</var> that has a <span data-x="she-step">step</span> greater than <var>step</var>.</p></li>
8284482856

8284582857
<li>
8284682858
<p><span data-x="list iterate">For each</span> <var>entry</var> of <var>entryList</var>:</p>
@@ -82909,7 +82921,7 @@ interface <dfn>BarProp</dfn> {
8290982921

8291082922
<li><p>Let <var>taskGlobals</var> be an empty <span data-x="ordered map">map</span> where the <span data-x="map key">keys</span> are <span data-x="agent">agents</span> and the <span data-x="map value">values</span> are <code>Window</code> objects.</p></li>
8291182923

82912-
<li><p>Let <var>entryLists</var> be the <span data-x="set">ordered set</span> « <var>navigable</var>'s <span data-x="tn-session-history-entries">session history entries</span> »</p></li>
82924+
<li><p>Let <var>entryLists</var> be the <span data-x="set">ordered set</span> « <var>navigable</var>'s <span data-x="tn-session-history-entries">session history entries</span> ».</p></li>
8291382925

8291482926
<li>
8291582927
<p><span data-x="list iterate">For each</span> <var>entryList</var> of <var>entryLists</var>:</p>
@@ -82932,9 +82944,7 @@ interface <dfn>BarProp</dfn> {
8293282944
<li>
8293382945
<p>If <var>targetEntry</var>'s <span data-x="she-document">document</span> is not null, then <span data-x="list iterate">for each</span> <var>nestedHistory</var> of <var>entry</var>'s <span data-x="she-document-state">document state</span>'s <span data-x="document-state-nested-histories">nested histories</span>, <span data-x="set append">append</span> <var>nestedHistory</var>'s <span data-x="nested-history-entries">entries list</span> to <var>entryLists</var>.</p>
8293482946

82935-
<p class="xxx">If the <span data-x="she-document">document</span> doesn't currently exist, its nested history will be recreated, although this isn't spec'd yet.</p>
82936-
82937-
JAKE-TODO: Should the document already be created by this point? What does the current spec do?
82947+
<p class="note">We need to visit these nested entries to make sure they're displaying the correct entry and have up-to-date history length/index.</p>
8293882948
</li>
8293982949

8294082950
<li><p>Let <var>agent</var> be <var>currentDocument</var>'s <span>relevant agent</span>.</p></li>
@@ -82961,7 +82971,7 @@ interface <dfn>BarProp</dfn> {
8296182971
<ol>
8296282972
<li><p>Set <var>targetEntry</var>'s <span data-x="she-bc">browsing context</span>'s <span data-x="bc-session">session</span>'s <span data-x="bs-script-visible-history-length">script-visible history length</span> to <var>scriptHistoryLength</var>.</p></li>
8296382973

82964-
<li><p>Set <var>targetEntry</var>'s <span data-x="she-bc">browsing context</span>'s <span data-x="bc-session">session</span>'s <span data-x="bc-script-visible-history-index">script-visible history index</span> to <var>scriptHistoryIndex</var>.</p></li>
82974+
<li><p>Set <var>targetEntry</var>'s <span data-x="she-bc">browsing context</span>'s <span data-x="bc-session">session</span>'s <span data-x="bs-script-visible-history-index">script-visible history index</span> to <var>scriptHistoryIndex</var>.</p></li>
8296582975
</ol>
8296682976

8296782977
<p class="note">This is only done for the <span>traversable navigable</span>, as all nested <span data-x="navigable">navigables</span> will be part of the same <span>browsing session</span>.</p>
@@ -86406,19 +86416,19 @@ new PaymentRequest(&hellip;); // Allowed to use
8640686416
<dt><span data-x="she-url">URL</span></dt>
8640786417
<dd><var>url</var></dd>
8640886418
<dt><span data-x="she-document-state">document state</span></dt>
86409-
<dd><var>navigable</var>'s <span data-x="nav-current-history-entry">current session history entry</span>'s <span data-x="she-document-state">document state</span></dd>
86419+
<dd><var>navigable</var>'s <span data-x="nav-displayed-history-entry">displayed session history entry</span>'s <span data-x="she-document-state">document state</span></dd>
8641086420
</dl>
8641186421
</li>
8641286422

86413-
<li><p>Let <var>entryToReplace</var> be <var>navigable</var>'s <span data-x="nav-current-history-entry">current session history entry</span> if <var>historyHandling</var> is "<code data-x="hh-replace">replace</code>", otherwise null.</p></li>
86423+
<li><p>Let <var>entryToReplace</var> be <var>navigable</var>'s <span data-x="nav-displayed-history-entry">displayed session history entry</span> if <var>historyHandling</var> is "<code data-x="hh-replace">replace</code>", otherwise null.</p></li>
8641486424

8641586425
<li>
8641686426
<p>If <var>historyHandling</var> is not "<code data-x="hh-replace">replace</code>", then:</p>
8641786427

8641886428
<ol>
8641986429
<li><p>Let <var>session</var> be <var>navigable</var>'s <span data-x="nav-bc">current browsing context</span>'s <span data-x="bc-session">session</span>.</p></li>
8642086430

86421-
<li><p>Increment <var>session</var>'s <span data-x="bc-script-visible-history-index">script-visible history index</span>.</p></li>
86431+
<li><p>Increment <var>session</var>'s <span data-x="bs-script-visible-history-index">script-visible history index</span>.</p></li>
8642286432

8642386433
<li>
8642486434
<p>Set <var>session</var>'s <span data-x="bs-script-visible-history-length">script-visible history length</span> to <var>session</var>'s <span data-x="bs-script-visible-history-index">script-visible history index</span> + 1.</p>
@@ -86428,7 +86438,7 @@ new PaymentRequest(&hellip;); // Allowed to use
8642886438
</ol>
8642986439
</li>
8643086440

86431-
<li><p>Set <var>navigable</var>'s <span data-x="nav-current-history-entry">current session history entry</span> to <var>historyEntry</var>.</p></li>
86441+
<li><p>Set <var>navigable</var>'s <span data-x="nav-displayed-history-entry">displayed session history entry</span> to <var>historyEntry</var>.</p></li>
8643286442

8643386443
<li><p>Let <var>traversable</var> be <var>navigable</var>'s <span data-x="nav-traversable">traversable navigable</span>.</p></li>
8643486444

@@ -86448,6 +86458,8 @@ new PaymentRequest(&hellip;); // Allowed to use
8644886458

8644986459
<li><p>Set <var>targetStep</var> to <var>traversable</var>'s <span data-x="tn-current-session-history-step">current session history step</span> + 1.</p></li>
8645086460

86461+
<li><p>Set <var>historyEntry</var>'s <span data-x="she-step">step</span> to <var>targetStep</var>.</p></li>
86462+
8645186463
<li><p><span data-x="list append">Append</span> <var>historyEntry</var> to <var>targetEntries</var>.</p></li>
8645286464
</ol>
8645386465

@@ -86456,12 +86468,12 @@ new PaymentRequest(&hellip;); // Allowed to use
8645686468
<ol>
8645786469
<li><p><span data-x="list replace">Replace</span> <var>entryToReplace</var> with <var>historyEntry</var>.</p></li>
8645886470

86459-
<li><p>Set <var>targetStep</var> to <var>entryToReplace</var>'s <span data-x="she-step">step</span>.</p></li>
86471+
<li><p>Set <var>historyEntry</var>'s <span data-x="she-step">step</span> to <var>entryToReplace</var>'s <span data-x="she-step">step</span>.</p></li>
86472+
86473+
<li><p>Set <var>targetStep</var> to <var>traversable</var>'s <span data-x="tn-current-session-history-step">current session history step</span>.</p></li>
8646086474
</ol>
8646186475
</li>
8646286476

86463-
<li><p>Set <var>historyEntry</var>'s <span data-x="she-step">step</span> to <var>targetStep</var>.</p></li>
86464-
8646586477
<li>
8646686478
<p><span>Apply the history step</span> <var>targetStep</var> to <var>traversable</var>.</p>
8646786479

0 commit comments

Comments
 (0)