Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 48 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ spec:html; type:dfn;
text:browsing context group set
text:unique internal value
</pre>
<pre class="anchors">
spec: html; type: dfn; urlPrefix: https://html.spec.whatwg.org/C
text: create and initialize a Document object; url: initialise-the-document-object
# Because `text` and `url` are the same (modulo slashes), we should be able to
# exclude `url`. But the colon breaks the URL in `text`, forcing us to include
# `url`.
text:is initial about:blank; url: is-initial-about:blank
text: associated Navigator
</pre>

<h2 id="intro">Introduction</h2>

Expand Down Expand Up @@ -113,6 +122,7 @@ A <dfn>model context</dfn> is a [=struct=] with the following [=struct/items=]:
[=structs=].
</dl>


A <dfn>tool definition</dfn> is a [=struct=] with the following [=struct/items=]:

<dl dfn-for="tool definition">
Expand Down Expand Up @@ -183,19 +193,47 @@ https://dlaliberte.github.io/bikeshed-intro/#a-strategy-for-incremental-developm

<h3 id="navigator-extension">Extensions to the {{Navigator}} Interface</h3>

The {{Navigator}} interface is extended to provide access to the {{ModelContext}}.
Each {{Navigator}} object has an <dfn for=Navigator>associated {{ModelContext}}</dfn>, which is a
{{ModelContext}} object.

Upon creation of the {{Navigator}} object, its [=Navigator/associated ModelContext|associated
<code>ModelContext</code>=] must be set to a [=new=] {{ModelContext}} object created in the
Comment thread
domfarolino marked this conversation as resolved.
{{Navigator}}'s [=relevant realm=]. It only ever changes from one `{{ModelContext}}` instance to
another the first time the {{Navigator/modelContext}} getter is accessed after a navigation away
from the [=is initial about:blank|initial <code>about:blank</code>=],

Note: The reason a {{Navigator}}'s [=Navigator/associated ModelContext|associated
<code>ModelContext</code>=] changes is as follows: {{ModelContext}} is a {{Document}}-scoped
registry of tools, but because it is accessed from an object that is shared between two {{Document}}
objects, it gets updated when the {{Navigator}}'s [=relevant global object=]'s
[=associated Document|associated <code>Document</code>=] gets updated, to ensure that tools registered within the [=is
initial about:blank|initial <code>about:blank</code>=] {{Document}} do not mix with tools in the
subsequent [=same origin=] {{Document}} See step 6.1 in [=create and initialize a Document
object|create and initialize a <code>Document</code> object=].

Each {{ModelContext}} object has a <dfn for=ModelContext>creation {{Document}}</dfn>, which is its
[=relevant global object=]s [=associated Document|associated <code>Document</code>=] at the time of creation.

<hr>

<xmp class="idl">
partial interface Navigator {
[SecureContext, SameObject] readonly attribute ModelContext modelContext;
[SecureContext] readonly attribute ModelContext modelContext;
};
</xmp>

Each {{Navigator}} object has an associated <dfn for=Navigator>modelContext</dfn>, which is a
{{ModelContext}} instance created alongside the {{Navigator}}.

<div algorithm>
The <dfn attribute for=Navigator>modelContext</dfn> getter steps are to return [=this=]'s [=Navigator/modelContext=].
The <dfn attribute for=Navigator>modelContext</dfn> getter steps are:

1. If [=this=]'s [=Navigator/associated ModelContext|associated <code>ModelContext</code>=]'s
[=ModelContext/creation Document| creation <code>Document</code>=] does not equal [=this=]'s
[=relevant global object=]'s [=associated Document|associated <code>Document</code>=], then set
[=this=]'s [=Navigator/associated ModelContext|associated <code>ModelContext</code>=] to a
[=new=] {{ModelContext}} object.

1. Return [=this=]'s [=Navigator/associated ModelContext|associated <code>ModelContext</code>=]
object.

</div>

<h3 id="model-context-container">ModelContext Interface</h3>
Expand Down Expand Up @@ -516,8 +554,10 @@ steps:
1. Let |id| be |document|'s [=Document/unique ID=].

1. Set |observation|'s [=observation/tool map=][|id|] = |document|'s [=relevant global
object=]'s {{Navigator}}'s [=Navigator/modelContext=]'s [=ModelContext/internal context=]'s
[=model context/tool map=]'s [=map/values=], which are [=tool definitions=].
object=]'s [=associated Navigator|associated <code>Navigator</code>=]'s
[=Navigator/associated ModelContext|associated <code>ModelContext</code>=]'s
[=ModelContext/internal context=]'s [=model context/tool map=]'s [=map/values=], which are
[=tool definitions=].

1. Perform any [=implementation-defined=] steps to add anything to |observation| that the [=user
agent=] might deem useful or necessary, besides just populating the [=observation/tool map=].
Expand Down
Loading