From 3be52faeccc24ab091f9306098df597e2e8d3b51 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 26 Nov 2018 14:50:26 +0100 Subject: [PATCH] Ground primitives in agents Using "unit of related similar-origin browsing contexts" never made much sense as a browsing context could always hold several cross-site documents. Helps with https://github.com/whatwg/html/issues/4198. Fixes #88. --- dom.bs | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/dom.bs b/dom.bs index a683e33a..793a57f9 100644 --- a/dom.bs +++ b/dom.bs @@ -2206,16 +2206,17 @@ steps:
Signaling slot change
-

Each unit of related similar-origin browsing contexts has a -signal slot list (a list of slots). Unless stated otherwise it is empty. -[[!HTML]] +

Each similar-origin window agent has a signal slot list (a list of +slots). Unless stated otherwise it is empty. [[!HTML]]

To signal a slot change, for a slot slot, run these steps:

    -
  1. If slot is not in unit of related similar-origin browsing contexts' - signal slot list, append slot to - unit of related similar-origin browsing contexts' signal slot list. +

  2. Let agent be the similar-origin window agent to which slot's + relevant Realm belongs. + +

  3. If slot is not in agent's signal slot list, then + append slot to agent's signal slot list.

  4. Queue a mutation observer compound microtask.

@@ -3189,13 +3190,12 @@ invoked, must run these steps:

Mutation observers

-

Each unit of related similar-origin browsing contexts has a +

Each similar-origin window agent has a mutation observer compound microtask queued flag, which is initially unset. [[!HTML]] -

Each unit of related similar-origin browsing contexts also has a -mutation observer list (a list of zero or more {{MutationObserver}} -objects), which is initially empty. +

Each similar-origin window agent also has a mutation observer list (a +list of zero or more {{MutationObserver}} objects), which is initially empty.

To queue a mutation observer compound microtask, run these steps: @@ -3213,15 +3213,17 @@ objects), which is initially empty.

  1. Unset mutation observer compound microtask queued flag. -

  2. Let notifyList be a clone of - unit of related similar-origin browsing contexts' mutation observer list. +

  3. Let agent be the similar-origin window agent current Realm belongs + to. -

  4. Let signalList be a clone of - unit of related similar-origin browsing contexts' signal slot list. +

  5. Let notifyList be a clone of agent's + mutation observer list. -

  6. Empty unit of related similar-origin browsing contexts' +

  7. Let signalList be a clone of agent's signal slot list. +

  8. Empty agent's signal slot list. +

  9. For each mo of notifyList, execute a compound microtask subtask to run these steps: [[!HTML]] @@ -3384,8 +3386,10 @@ constructor, when invoked, must run these steps:

  10. Let mo be a new {{MutationObserver}} object whose callback is callback. -

  11. Append mo to - unit of related similar-origin browsing contexts' mutation observer list. +

  12. Let agent be the similar-origin window agent mo's + relevant Realm belongs to. + +

  13. Append mo to agent's mutation observer list.

  14. Return mo.