OLD | NEW |
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 Loading... |
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; | 43 class CustomElementRegistry; |
44 | 44 |
45 class V0CustomElementRegistrationContext final : public GarbageCollectedFinalize
d<V0CustomElementRegistrationContext> { | 45 class V0CustomElementRegistrationContext final : public GarbageCollectedFinalize
d<V0CustomElementRegistrationContext> { |
46 public: | 46 public: |
47 static V0CustomElementRegistrationContext* create() | 47 static V0CustomElementRegistrationContext* create() |
48 { | 48 { |
49 return new V0CustomElementRegistrationContext(); | 49 return new V0CustomElementRegistrationContext(); |
50 } | 50 } |
51 | 51 |
52 ~V0CustomElementRegistrationContext() { } | 52 ~V0CustomElementRegistrationContext() { } |
53 void documentWasDetached() { m_registry.documentWasDetached(); } | 53 void documentWasDetached() { m_registry.documentWasDetached(); } |
54 | 54 |
55 // Definitions | 55 // Definitions |
56 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&); |
57 | 57 |
58 Element* createCustomTagElement(Document&, const QualifiedName&); | 58 Element* createCustomTagElement(Document&, const QualifiedName&); |
59 static void setIsAttributeAndTypeExtension(Element*, const AtomicString& typ
e); | 59 static void setIsAttributeAndTypeExtension(Element*, const AtomicString& typ
e); |
60 static void setTypeExtension(Element*, const AtomicString& type); | 60 static void setTypeExtension(Element*, const AtomicString& type); |
61 | 61 |
62 void resolve(Element*, const V0CustomElementDescriptor&); | 62 void resolve(Element*, const V0CustomElementDescriptor&); |
63 | 63 |
64 bool nameIsDefined(const AtomicString& name) const; | 64 bool nameIsDefined(const AtomicString& name) const; |
65 void setV1(const CustomElementsRegistry*); | 65 void setV1(const CustomElementRegistry*); |
66 | 66 |
67 DECLARE_TRACE(); | 67 DECLARE_TRACE(); |
68 | 68 |
69 protected: | 69 protected: |
70 V0CustomElementRegistrationContext(); | 70 V0CustomElementRegistrationContext(); |
71 | 71 |
72 // Instance creation | 72 // Instance creation |
73 void didGiveTypeExtension(Element*, const AtomicString& type); | 73 void didGiveTypeExtension(Element*, const AtomicString& type); |
74 | 74 |
75 private: | 75 private: |
76 void resolveOrScheduleResolution(Element*, const AtomicString& typeExtension
); | 76 void resolveOrScheduleResolution(Element*, const AtomicString& typeExtension
); |
77 | 77 |
78 V0CustomElementRegistry m_registry; | 78 V0CustomElementRegistry m_registry; |
79 | 79 |
80 // Element creation | 80 // Element creation |
81 Member<V0CustomElementUpgradeCandidateMap> m_candidates; | 81 Member<V0CustomElementUpgradeCandidateMap> m_candidates; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif // V0CustomElementRegistrationContext_h | 86 #endif // V0CustomElementRegistrationContext_h |
OLD | NEW |