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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistrationContext.h

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement feedback. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 22 matching lines...) Expand all
33 33
34 #include "core/dom/QualifiedName.h" 34 #include "core/dom/QualifiedName.h"
35 #include "core/dom/custom/V0CustomElementDescriptor.h" 35 #include "core/dom/custom/V0CustomElementDescriptor.h"
36 #include "core/dom/custom/V0CustomElementRegistry.h" 36 #include "core/dom/custom/V0CustomElementRegistry.h"
37 #include "core/dom/custom/V0CustomElementUpgradeCandidateMap.h" 37 #include "core/dom/custom/V0CustomElementUpgradeCandidateMap.h"
38 #include "platform/heap/Handle.h" 38 #include "platform/heap/Handle.h"
39 #include "wtf/text/AtomicString.h" 39 #include "wtf/text/AtomicString.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class CustomElementsRegistry;
44
43 class V0CustomElementRegistrationContext final : public GarbageCollectedFinalize d<V0CustomElementRegistrationContext> { 45 class V0CustomElementRegistrationContext final : public GarbageCollectedFinalize d<V0CustomElementRegistrationContext> {
44 public: 46 public:
45 static V0CustomElementRegistrationContext* create() 47 static V0CustomElementRegistrationContext* create()
46 { 48 {
47 return new V0CustomElementRegistrationContext(); 49 return new V0CustomElementRegistrationContext();
48 } 50 }
49 51
50 ~V0CustomElementRegistrationContext() { } 52 ~V0CustomElementRegistrationContext() { }
51 void documentWasDetached() { m_registry.documentWasDetached(); } 53 void documentWasDetached() { m_registry.documentWasDetached(); }
52 54
53 // Definitions 55 // Definitions
54 void registerElement(Document*, V0CustomElementConstructorBuilder*, const At omicString& type, V0CustomElement::NameSet validNames, ExceptionState&); 56 void registerElement(Document*, V0CustomElementConstructorBuilder*, const At omicString& type, V0CustomElement::NameSet validNames, ExceptionState&);
55 57
56 Element* createCustomTagElement(Document&, const QualifiedName&); 58 Element* createCustomTagElement(Document&, const QualifiedName&);
57 static void setIsAttributeAndTypeExtension(Element*, const AtomicString& typ e); 59 static void setIsAttributeAndTypeExtension(Element*, const AtomicString& typ e);
58 static void setTypeExtension(Element*, const AtomicString& type); 60 static void setTypeExtension(Element*, const AtomicString& type);
59 61
60 void resolve(Element*, const V0CustomElementDescriptor&); 62 void resolve(Element*, const V0CustomElementDescriptor&);
61 63
64 bool nameIsDefined(const AtomicString& name) const;
65 void setV1(const CustomElementsRegistry*);
66
62 DECLARE_TRACE(); 67 DECLARE_TRACE();
63 68
64 protected: 69 protected:
65 V0CustomElementRegistrationContext(); 70 V0CustomElementRegistrationContext();
66 71
67 // Instance creation 72 // Instance creation
68 void didGiveTypeExtension(Element*, const AtomicString& type); 73 void didGiveTypeExtension(Element*, const AtomicString& type);
69 74
70 private: 75 private:
71 void resolveOrScheduleResolution(Element*, const AtomicString& typeExtension ); 76 void resolveOrScheduleResolution(Element*, const AtomicString& typeExtension );
72 77
73 V0CustomElementRegistry m_registry; 78 V0CustomElementRegistry m_registry;
74 79
75 // Element creation 80 // Element creation
76 Member<V0CustomElementUpgradeCandidateMap> m_candidates; 81 Member<V0CustomElementUpgradeCandidateMap> m_candidates;
77 }; 82 };
78 83
79 } // namespace blink 84 } // namespace blink
80 85
81 #endif // V0CustomElementRegistrationContext_h 86 #endif // V0CustomElementRegistrationContext_h
82
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698