summaryrefslogtreecommitdiffstats
path: root/dom/base/CustomElementRegistry.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-18 20:35:11 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:39 -0500
commitb7f890e02e6bf24db172881d6da910e70c7586fe (patch)
treebd9598a66bbd5f9a52fc51c291bc0dd2c8507856 /dom/base/CustomElementRegistry.h
parentfce396323da02695c266579d229f11bf0959280b (diff)
downloadUXP-b7f890e02e6bf24db172881d6da910e70c7586fe.tar
UXP-b7f890e02e6bf24db172881d6da910e70c7586fe.tar.gz
UXP-b7f890e02e6bf24db172881d6da910e70c7586fe.tar.lz
UXP-b7f890e02e6bf24db172881d6da910e70c7586fe.tar.xz
UXP-b7f890e02e6bf24db172881d6da910e70c7586fe.zip
Bug 1410790 - Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition;
This is a follow-up patch for bug 1392970. Since we only set CustomElementDefinition on a custom element which is custom, we could add more assertion to ensure that. Tag UXP Issue #1344
Diffstat (limited to 'dom/base/CustomElementRegistry.h')
-rw-r--r--dom/base/CustomElementRegistry.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h
index 867c92647..d3dfef682 100644
--- a/dom/base/CustomElementRegistry.h
+++ b/dom/base/CustomElementRegistry.h
@@ -130,24 +130,16 @@ struct CustomElementData
// e.g., create an element, insert a node.
AutoTArray<UniquePtr<CustomElementReaction>, 3> mReactionQueue;
- RefPtr<CustomElementDefinition> mCustomElementDefinition;
-
- void
- SetCustomElementDefinition(CustomElementDefinition* aDefinition)
- {
- MOZ_ASSERT(!mCustomElementDefinition);
-
- mCustomElementDefinition = aDefinition;
- }
+ void SetCustomElementDefinition(CustomElementDefinition* aDefinition);
+ CustomElementDefinition* GetCustomElementDefinition();
- CustomElementDefinition*
- GetCustomElementDefinition()
- {
- return mCustomElementDefinition;
- }
+ void Traverse(nsCycleCollectionTraversalCallback& aCb) const;
+ void Unlink();
private:
virtual ~CustomElementData() {}
+
+ RefPtr<CustomElementDefinition> mCustomElementDefinition;
};
#define ALEADY_CONSTRUCTED_MARKER nullptr
@@ -167,7 +159,8 @@ struct CustomElementDefinition
mozilla::dom::LifecycleCallbacks* aCallbacks,
uint32_t aDocOrder);
- // The type (name) for this custom element.
+ // The type (name) for this custom element, for <button is="x-foo"> or <x-foo>
+ // this would be x-foo.
nsCOMPtr<nsIAtom> mType;
// The localname to (e.g. <button is=type> -- this would be button).