Skip to content

Commit

Permalink
Editorial: formalize the concept of a realm's agent
Browse files Browse the repository at this point in the history
Follows tc39/ecma262#3058. See tc39/ecma262#1357 for more background.

Adding final step to mask cross-origin

Mask preventedBFCache

Call build nrr for page from unload

fix indentation

Use set to
  • Loading branch information
syg authored and rubberyuzu committed Jul 21, 2023
1 parent a9d84f6 commit 0a2d20a
Showing 1 changed file with 89 additions and 9 deletions.
98 changes: 89 additions & 9 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -94018,7 +94018,8 @@ location.href = '#foo';</code></pre>

<li>
<p>Otherwise, <span>process the next manual redirect</span> for
<var>fetchController</var>.</p>
<var>fetchController</var>, and set <var>entry</var>'s <span>document state</span>'s <span
data-x="document-state-not-restored-reasons">notRestoredReasons</span> to null.</p>

<p class="note">This will result in calling the <i
data-x="processResponse">processResponse</i> we supplied above, during our first iteration
Expand Down Expand Up @@ -95432,6 +95433,80 @@ location.href = '#foo';</code></pre>
</ol>


<p>To <dfn>build NotRestoredReasons object for page</dfn> given <code>Document state</code>
<var>documentState</var>:
<ol>
<li><p><span>Assert</span>: <var>documentState</var>'s <span
data-x="document-state-document">document</span>'s <span>node navigable</span> is a
<span>top-level traversable</span>.</p></li>

<li><p><span>Build NotRestoredReasons object for document</span> given <var>documentState</var>'s
<span data-x="document-state-document">document</span>.</p></li>

<li><p>Count the number of <var>documentState</var>'s <span
data-x="document-state-document">document</span>'s <span>descendant navigables</span> whose
<span data-x="concept-document-origin">origin</span> is not <span>same origin</span> with
<var>documentState</var>'s <span data-x="document-state-document">document</span>.</p>

<ol>
<li><p>Let <var>crossOriginDescendants</var> be an empty <span>list</span>.</p></li>

<li><p><span data-x="list iterate">For each</span> <var>navigable</var> of
<var>documentState</var>'s <span data-x="document-state-document">document</span>'s
<span>descendant navigables</span>:</p>
<ol>
<li><p>If <var>navigable</var>'s <span data-x="nav-document">active document</span>'s
<span data-x="concept-document-origin">origin</span> is not <span>same origin</span> with
<var>documentState</var>'s <span data-x="document-state-document">document</span>, then <span
data-x="list append">append</span> <var>navigable</var> to
<var>crossOriginDescendants</var>.</p></li>
</ol>
</li>

<li><p>Set <var>crossOriginCount</var> be <var>crossOriginDescendants</var>'s <span
data-x="list size">size</span>.</p></li>
</ol>
</li>

<li><p>Let <var>randomIndex</var> be a randomly selected integer from 0 to
<var>crossOriginCount</var>-1.</p></li>

<li><p>Let <var>index</var> be 0.</p></li>

<li><p><span data-x="list iterate">For each</span> <var>navigable</var> of
<var>documentState</var>'s <span data-x="document-state-document">document</span>'s
<span>descendant navigables</span>:</p>
<ol>
<li><p>If <var>navigable</var>'s <span data-x="nav-document">active document</span>'s
<span data-x="concept-document-origin">origin</span> is not <span>same origin</span> with
<var>documentState</var>'s <span data-x="document-state-document">document</span>, then:</p>

<ol>
<li><p>Let <var>reasonsForCrossOriginChild</var> be <var>navigable</var>'s <span
data-x="nav-document">active document</span>'s <span>document state</span>'s <span
data-x="document-state-not-restored-reasons">notRestoredReasons</span>.</p></li>

<li><p>Set <var>reasonsForCrossOriginChild</var>'s <span
data-x="dom-not-restored-reasons-url">url</span> to null.</p></li>

<li><p>Set <var>reasonsForCrossOriginChild</var>'s <span
data-x="dom-not-restored-reasons-reasons">reasons</span> to null.</p></li>

<li><p>Set <var>reasonsForCrossOriginChild</var>'s <span
data-x="dom-not-restored-reasons-children">children</span> to null.</p></li>

<li><p>If <var>index</var> is not equal to <var>randomIndex</var>, then set
<var>reasonsForCrossOriginChild</var>'s <span
data-x="dom-not-restored-reasons-prevented-back-forward-cache">preventedBackForwardCache</span>
to "<code data-x="dom-PreventedBackForwardCache-masked">masked</code>".</p></li>

<li><p>Increment <var>index</var> by 1.</p></li>
</ol>
</li>
</ol>
</li>
</ol>

<h5>Scrolling to a fragment</h5>

<p>To <dfn id="scroll-to-the-fragment-identifier">scroll to the fragment</dfn> given a
Expand Down Expand Up @@ -96533,6 +96608,12 @@ new PaymentRequest(&hellip;); // Allowed to use
<li><p>Run any <span>unloading document cleanup steps</span> for <var>oldDocument</var> that are
defined by this specification and <span>other applicable specifications</span>.</p></li>

<li><p>If <var>oldDocument</var>'s <span>node navigable</span> is a
<span>top-level traversable</span>, <span>build NotRestoredReasons object for page</span> given
<var>oldDocument</var>'s <span>node navigable</span>'s <span
data-x="nav-active-history-entry">active session history entry</span>'s <span
data-x="she-document-state">document state</span>.</p></li>

<li><p>If <var>oldDocument</var>'s <i data-x="concept-document-salvageable">salvageable</i> state
is false, then <span data-x="destroy a document">destroy</span> <var>oldDocument</var>.</p></li>

Expand Down Expand Up @@ -97148,11 +97229,14 @@ new PaymentRequest(&hellip;); // Allowed to use
<li><p>Return <var>agent</var>.</p></li>
</ol>

<p>For a <span>realm</span> <var>realm</var>, the <span>agent</span> whose [[Signifier]] is
<var>realm</var>.[[AgentSignifier]] is <dfn data-x="realm's agent" export data-lt="agent"
for="realm">the realm's agent</dfn>.</p>

<p>The <dfn export>relevant agent</dfn> for a <span>platform object</span>
<var>platformObject</var> is <var>platformObject</var>'s <span
data-x="concept-relevant-realm">relevant realm</span>'s <span>agent</span>. <span class="XXX"
data-x="">This pointer is not yet defined in the JavaScript specification; see <a
href="https://github.com/tc39/ecma262/issues/1357">tc39/ecma262#1357</a>.</span></p>
data-x="concept-relevant-realm">relevant realm</span>'s <span data-x="realm's
agent">agent</span>.</p>

<p class="note">The agent equivalent of the <span>current realm</span> is the <span>surrounding
agent</span>.</p>
Expand Down Expand Up @@ -97300,7 +97384,7 @@ new PaymentRequest(&hellip;); // Allowed to use
<li><p><span>Assert</span>: <var>outside settings</var> is not null.</p></li>

<li><p>Let <var>ownerAgent</var> be <var>outside settings</var>'s <span data-x="environment
settings object's realm">realm</span>'s agent.</p></li>
settings object's realm">realm</span>'s <span data-x="realm's agent">agent</span>.</p></li>

<li><p>Set <var>agentCluster</var> to the agent cluster which contains
<var>ownerAgent</var>.</p></li>
Expand Down Expand Up @@ -97603,10 +97687,6 @@ new PaymentRequest(&hellip;); // Allowed to use

<li><p>Let <var>realm</var> be <var>realm execution context</var>'s Realm component.</p></li>

<li><p>Set <var>realm</var>'s agent to <var>agent</var>. <span class="XXX" data-x="">This pointer
is not yet defined in the JavaScript specification; see <a
href="https://github.com/tc39/ecma262/issues/1357">tc39/ecma262#1357</a>.</span></p></li>

<li>
<p>If <var>agent</var>'s <span>agent cluster</span>'s <span
data-x="agent-cluster-cross-origin-isolation">cross-origin isolation mode</span> is "<code
Expand Down

0 comments on commit 0a2d20a

Please sign in to comment.