summaryrefslogtreecommitdiffstats
path: root/dom/base/CustomElementRegistry.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-02 21:25:47 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:09 -0500
commit5222f6e9daa4cb74b404f769b23510b3d600efd9 (patch)
treee00a760b5b662dcfb35e2849ea1e9d83c85617e2 /dom/base/CustomElementRegistry.cpp
parent244277a3fa428b70ba46cf611dbe1905733515eb (diff)
downloadUXP-5222f6e9daa4cb74b404f769b23510b3d600efd9.tar
UXP-5222f6e9daa4cb74b404f769b23510b3d600efd9.tar.gz
UXP-5222f6e9daa4cb74b404f769b23510b3d600efd9.tar.lz
UXP-5222f6e9daa4cb74b404f769b23510b3d600efd9.tar.xz
UXP-5222f6e9daa4cb74b404f769b23510b3d600efd9.zip
Bug 1274159 - Part 2-2: Support HTMLConstructor WebIDL extended attribute for custom elements;
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/CustomElementRegistry.cpp')
-rw-r--r--dom/base/CustomElementRegistry.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 43e4e7e2a..6cd213210 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -273,6 +273,23 @@ CustomElementRegistry::LookupCustomElementDefinition(const nsAString& aLocalName
return nullptr;
}
+CustomElementDefinition*
+CustomElementRegistry::LookupCustomElementDefinition(JSContext* aCx,
+ JSObject* aConstructor) const
+{
+ JS::Rooted<JSObject*> constructor(aCx, js::CheckedUnwrap(aConstructor));
+
+ const auto& ptr = mConstructors.lookup(constructor);
+ if (!ptr) {
+ return nullptr;
+ }
+
+ CustomElementDefinition* definition = mCustomDefinitions.Get(ptr->value());
+ MOZ_ASSERT(definition, "Definition must be found in mCustomDefinitions");
+
+ return definition;
+}
+
void
CustomElementRegistry::RegisterUnresolvedElement(Element* aElement, nsIAtom* aTypeName)
{