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.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h
index b5903f978..b85d089f9 100644
--- a/dom/base/CustomElementRegistry.h
+++ b/dom/base/CustomElementRegistry.h
@@ -128,6 +128,7 @@ struct CustomElementDefinition
CustomElementDefinition(nsIAtom* aType,
nsIAtom* aLocalName,
Function* aConstructor,
+ nsCOMArray<nsIAtom>&& aObservedAttributes,
JSObject* aPrototype,
mozilla::dom::LifecycleCallbacks* aCallbacks,
uint32_t aDocOrder);
@@ -141,6 +142,9 @@ struct CustomElementDefinition
// The custom element constructor.
RefPtr<CustomElementConstructor> mConstructor;
+ // The list of attributes that this custom element observes.
+ nsCOMArray<nsIAtom> mObservedAttributes;
+
// The prototype to use for new custom elements of this type.
JS::Heap<JSObject *> mPrototype;
@@ -153,9 +157,19 @@ struct CustomElementDefinition
// The document custom element order.
uint32_t mDocOrder;
- bool IsCustomBuiltIn() {
+ bool IsCustomBuiltIn()
+ {
return mType != mLocalName;
}
+
+ bool IsInObservedAttributeList(nsIAtom* aName)
+ {
+ if (mObservedAttributes.IsEmpty()) {
+ return false;
+ }
+
+ return mObservedAttributes.Contains(aName);
+ }
};
class CustomElementReaction