summaryrefslogtreecommitdiffstats
path: root/dom/base/CustomElementRegistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/CustomElementRegistry.h')
-rw-r--r--dom/base/CustomElementRegistry.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h
index 24d501d73..6184c0ac3 100644
--- a/dom/base/CustomElementRegistry.h
+++ b/dom/base/CustomElementRegistry.h
@@ -71,7 +71,18 @@ struct CustomElementData
{
NS_INLINE_DECL_REFCOUNTING(CustomElementData)
+ // https://dom.spec.whatwg.org/#concept-element-custom-element-state
+ // CustomElementData is only created on the element which is a custom element
+ // or an upgrade candidate, so the state of an element without
+ // CustomElementData is "uncustomized".
+ enum class State {
+ eUndefined,
+ eFailed,
+ eCustom
+ };
+
explicit CustomElementData(nsIAtom* aType);
+ CustomElementData(nsIAtom* aType, State aState);
// Objects in this array are transient and empty after each microtask
// checkpoint.
nsTArray<nsAutoPtr<CustomElementCallback>> mCallbackQueue;
@@ -89,6 +100,8 @@ struct CustomElementData
// it is used to determine if a new queue needs to be pushed onto the
// processing stack.
int32_t mAssociatedMicroTask;
+ // Custom element state as described in the custom element spec.
+ State mState;
// Empties the callback queue.
void RunCallbackQueue();