diff --git a/index.bs b/index.bs index 3a0c2a7..5919b83 100644 --- a/index.bs +++ b/index.bs @@ -86,6 +86,15 @@ spec:html; type:dfn; text:browsing context group set text:unique internal value +
+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
+

Introduction

@@ -113,6 +122,7 @@ A model context is a [=struct=] with the following [=struct/items=]: [=structs=]. + A tool definition is a [=struct=] with the following [=struct/items=]:
@@ -183,19 +193,47 @@ https://dlaliberte.github.io/bikeshed-intro/#a-strategy-for-incremental-developm -The {{Navigator}} interface is extended to provide access to the {{ModelContext}}. +Each {{Navigator}} object has an associated {{ModelContext}}, which is a +{{ModelContext}} object. + +Upon creation of the {{Navigator}} object, its [=Navigator/associated ModelContext|associated +ModelContext=] must be set to a [=new=] {{ModelContext}} object created in the +{{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 about:blank=], + +Note: The reason a {{Navigator}}'s [=Navigator/associated ModelContext|associated +ModelContext=] 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 Document=] gets updated, to ensure that tools registered within the [=is +initial about:blank|initial about:blank=] {{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 Document object=]. + +Each {{ModelContext}} object has a creation {{Document}}, which is its +[=relevant global object=]s [=associated Document|associated Document=] at the time of creation. + +
partial interface Navigator { - [SecureContext, SameObject] readonly attribute ModelContext modelContext; + [SecureContext] readonly attribute ModelContext modelContext; }; -Each {{Navigator}} object has an associated modelContext, which is a -{{ModelContext}} instance created alongside the {{Navigator}}. -
-The modelContext getter steps are to return [=this=]'s [=Navigator/modelContext=]. +The modelContext getter steps are: + +1. If [=this=]'s [=Navigator/associated ModelContext|associated ModelContext=]'s + [=ModelContext/creation Document| creation Document=] does not equal [=this=]'s + [=relevant global object=]'s [=associated Document|associated Document=], then set + [=this=]'s [=Navigator/associated ModelContext|associated ModelContext=] to a + [=new=] {{ModelContext}} object. + +1. Return [=this=]'s [=Navigator/associated ModelContext|associated ModelContext=] + object. +

ModelContext Interface

@@ -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 Navigator=]'s + [=Navigator/associated ModelContext|associated ModelContext=]'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=].