From 050069b1957ffae2b9a41bd8d6d34be8b8945a7a Mon Sep 17 00:00:00 2001
From: Anne van Kesteren Each unit of related similar-origin browsing contexts has a custom element
- reactions stack, which is initially empty. The current element queue is the
- element queue at the top of the custom element reactions stack. Each
- item in the stack is an element queue, which is initially empty as well. Each item in
- an element queue is an element. (The elements are not necessarily Each similar-origin window agent has a custom element reactions stack,
+ which is initially empty. The current element queue is the element queue
+ at the top of the custom element reactions stack. Each item in the stack is an
+ element queue, which is initially empty as well. Each item in an element
+ queue is an element. (The elements are not necessarily custom yet, since this queue is used for upgrades as well.)
-
Let agent be the similar-origin window agent element's + relevant Realm belongs to. + +
Let reactionsStack be agent's custom element reactions + stack. +
If the custom element reactions stack is empty, then:
+If reactionsStack is empty, then:
Add element to the backup element queue.
Add element to reactionsStack's backup element + queue.
If the processing the backup element queue flag is set, then - return.
If reactionsStack's processing the backup element queue flag is + set, then return.
Set the processing the backup element queue flag.
Set reactionsStack's processing the backup element queue + flag.
Queue a microtask to perform the following steps:
Invoke custom element reactions in the backup element - queue.
Invoke custom element reactions in reactionsStack's + backup element queue.
Unset the processing the backup element queue flag.
Unset reactionsStack's processing the backup element queue + flag.
Otherwise, add element to the current element queue.
Otherwise, add element to agent's current element + queue.
To enqueue a custom element callback reaction, given a custom @@ -67217,15 +67227,18 @@ customElements.define("x-foo", class extends HTMLElement { of the ones specified in their description:
Push a new element queue onto the - custom element reactions stack.
Let agent be the similar-origin window agent this object's + relevant Realm belongs to. + +
Push a new element queue onto + agent's custom element reactions stack.
Run the originally-specified steps for this construct, catching any exceptions. If the steps return a value, let value be the returned value. If they throw an exception, let exception be the thrown exception.
Let queue be the result of popping from the - custom element reactions stack.
Let queue be the result of popping from + agent's custom element reactions stack.
Invoke custom element reactions in queue.
Let document be intended parent's node document.
Let agent be the similar-origin window agent document's + relevant Realm belongs to. +
Let local name be the tag name of the token.
Let is be the value of the "is
" attribute in the
@@ -105873,8 +105889,8 @@ dictionary StorageEventInit : EventInit {
If the JavaScript execution context stack is empty, then perform a microtask checkpoint.
Push a new element queue onto the custom element reactions - stack.
Push a new element queue onto agent's custom element + reactions stack.
If will execute script is true, then:
Let queue be the result of popping the current element queue - from the custom element reactions stack. (This will be the same element - queue as was pushed above.)
Let queue be the result of popping agent's current element + queue. (This will be the same element queue as was pushed above.)
Invoke custom element reactions in queue.
Let agent be the similar-origin window agent element's + relevant Realm belongs to. +
If it is possible to insert element at the adjusted insertion location, then:
Push a new element queue onto the custom element reactions - stack.
Push a new element queue onto agent's custom element + reactions stack.
Insert element at the adjusted insertion location.
Pop the element queue from the custom element reactions stack, - and invoke custom element reactions in that queue.
Pop the element queue from agent's custom element + reactions stack and invoke custom element reactions in that queue.
If the adjusted insertion location cannot accept more