Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h

Issue 2200613002: The HTML parser synchronously creates custom elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Eliminate redundant TODOs. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
index e5b58b4a9287c5665fa756be7cbabcc950dbc777..ecb207450cf916b18a21ff3d43def17807226747 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
@@ -20,10 +20,10 @@ namespace blink {
class CustomElementDefinition;
class CustomElementDefinitionBuilder;
class CustomElementDescriptor;
-class Document;
class Element;
class ElementRegistrationOptions;
class ExceptionState;
+class LocalDOMWindow;
class ScriptPromiseResolver;
class ScriptState;
class ScriptValue;
@@ -35,7 +35,7 @@ class CORE_EXPORT CustomElementsRegistry final
DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(CustomElementsRegistry);
public:
- static CustomElementsRegistry* create(Document*);
+ static CustomElementsRegistry* create(const LocalDOMWindow*);
virtual ~CustomElementsRegistry() = default;
@@ -56,6 +56,10 @@ public:
bool nameIsDefined(const AtomicString& name) const;
CustomElementDefinition* definitionForName(const AtomicString& name) const;
+ // TODO(dominicc): Switch most callers of definitionForName to
+ // definitionFor when implementing type extensions.
+ CustomElementDefinition* definitionFor(const CustomElementDescriptor&) const;
+
// TODO(dominicc): Consider broadening this API when type extensions are
// implemented.
void addCandidate(Element*);
@@ -64,14 +68,15 @@ public:
const AtomicString& name,
ExceptionState&);
+ void entangle(V0CustomElementRegistrationContext*);
+
DECLARE_TRACE();
private:
- friend class CustomElementsRegistryTestBase;
+ friend class CustomElementsRegistryTest;
- CustomElementsRegistry(Document*);
+ CustomElementsRegistry(const LocalDOMWindow*);
- V0CustomElementRegistrationContext* v0();
bool v0NameIsDefined(const AtomicString& name);
void collectCandidates(
@@ -85,7 +90,10 @@ private:
HeapHashMap<AtomicString, Member<CustomElementDefinition>>;
DefinitionMap m_definitions;
- Member<Document> m_document;
+ Member<const LocalDOMWindow> m_owner;
+
+ using V0RegistrySet = HeapHashSet<WeakMember<V0CustomElementRegistrationContext>>;
+ Member<V0RegistrySet> m_v0;
using UpgradeCandidateSet = HeapHashSet<WeakMember<Element>>;
using UpgradeCandidateMap = HeapHashMap<
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698