From d00b810aeccf9a272b17400ed3daed7f100adec1 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
Let constructResult be Construct(C).
+Run the following substeps while catching any exceptions:
-If C non-conformantly uses
- an API decorated with the [CEReactions]
extended attribute,
- then the reactions enqueued at the beginning of this algorithm will execute during this step,
- before C finishes and control returns to this algorithm. Otherwise, they will execute
- after C and the rest of the upgrade process finishes.
Let constructResult be Construct(C).
-Remove the last entry from the end of definition's construction stack.
+If C non-conformantly
+ uses an API decorated with the [CEReactions]
extended
+ attribute, then the reactions enqueued at the beginning of this algorithm will execute during
+ this step, before C finishes and control returns to this algorithm. Otherwise, they
+ will execute after C and the rest of the upgrade process finishes.
Assuming C calls super()
(as it will if it is conformant), and that the call succeeds, this will be
- the already
- constructed marker that replaced the element we pushed at the beginning
- of this algorithm. (The HTML element constructor
- carries out this replacement.)
If C does not call super()
(i.e. it is not conformant), or if any step in the HTML element constructor throws, then this entry will
- still be element.
If SameValue(constructResult, element) is false,
+ then throw an "InvalidStateError
" DOMException
.
If constructResult is an abrupt completion, then:
+This can occur if C constructs another instance of the same custom
+ element before calling super()
, or if C uses JavaScript's
+ return
-override feature to return an arbitrary object from the
+ constructor.
Then, perform the following substep, regardless of whether the above steps threw an exception + or not:
Set element's custom element state to "failed
".
Remove the last entry from the end of definition's construction stack.
-Return constructResult (i.e., rethrow the exception), and terminate these - steps.
Assuming C calls super()
(as it will if it is conformant), and that the call succeeds, this will be
+ the already
+ constructed marker that replaced the element we pushed at the beginning
+ of this algorithm. (The HTML element constructor
+ carries out this replacement.)
If C does not call super()
(i.e. it is not conformant), or if any step in the HTML element constructor throws, then this entry will
+ still be element.
If SameValue(constructResult.[[value]], element) is false, - then:
+Finally, if the above steps threw an exception, then:
Set element's custom element state to "failed
".
Throw an "InvalidStateError
" DOMException
, and
- terminate these steps.
Empty element's custom element reaction queue.
-This can occur if C constructs another instance of the same custom
- element before calling super()
, or if C uses JavaScript's
- return
-override feature to return an arbitrary object from the
- constructor.
Rethrow the exception, and terminate this algorithm.
Set element's custom element state to "