| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CustomElementDefinition_h | 5 #ifndef CustomElementDefinition_h |
| 6 #define CustomElementDefinition_h | 6 #define CustomElementDefinition_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" | 8 #include "bindings/core/v8/ScriptValue.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/dom/custom/CustomElementDescriptor.h" | 10 #include "core/dom/custom/CustomElementDescriptor.h" |
| 11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/HashSet.h" | 12 #include "wtf/HashSet.h" |
| 13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 #include "wtf/text/AtomicString.h" | 14 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/AtomicStringHash.h" | 15 #include "wtf/text/AtomicStringHash.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class Document; |
| 19 class Element; | 20 class Element; |
| 20 class ExceptionState; | 21 class ExceptionState; |
| 21 class HTMLElement; | 22 class HTMLElement; |
| 22 class QualifiedName; | 23 class QualifiedName; |
| 23 | 24 |
| 24 class CORE_EXPORT CustomElementDefinition | 25 class CORE_EXPORT CustomElementDefinition |
| 25 : public GarbageCollectedFinalized<CustomElementDefinition> { | 26 : public GarbageCollectedFinalized<CustomElementDefinition> { |
| 26 WTF_MAKE_NONCOPYABLE(CustomElementDefinition); | 27 WTF_MAKE_NONCOPYABLE(CustomElementDefinition); |
| 27 public: | 28 public: |
| 28 CustomElementDefinition(const CustomElementDescriptor&); | 29 CustomElementDefinition(const CustomElementDescriptor&); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 56 void upgrade(Element*); | 57 void upgrade(Element*); |
| 57 | 58 |
| 58 virtual bool hasConnectedCallback() const = 0; | 59 virtual bool hasConnectedCallback() const = 0; |
| 59 virtual bool hasDisconnectedCallback() const = 0; | 60 virtual bool hasDisconnectedCallback() const = 0; |
| 60 virtual bool hasAdoptedCallback() const = 0; | 61 virtual bool hasAdoptedCallback() const = 0; |
| 61 bool hasAttributeChangedCallback(const QualifiedName&) const; | 62 bool hasAttributeChangedCallback(const QualifiedName&) const; |
| 62 bool hasStyleAttributeChangedCallback() const; | 63 bool hasStyleAttributeChangedCallback() const; |
| 63 | 64 |
| 64 virtual void runConnectedCallback(Element*) = 0; | 65 virtual void runConnectedCallback(Element*) = 0; |
| 65 virtual void runDisconnectedCallback(Element*) = 0; | 66 virtual void runDisconnectedCallback(Element*) = 0; |
| 66 virtual void runAdoptedCallback(Element*) = 0; | 67 virtual void runAdoptedCallback( |
| 68 Element*, Document* oldOwner, Document* newOwner) = 0; |
| 67 virtual void runAttributeChangedCallback(Element*, const QualifiedName&, | 69 virtual void runAttributeChangedCallback(Element*, const QualifiedName&, |
| 68 const AtomicString& oldValue, const AtomicString& newValue) = 0; | 70 const AtomicString& oldValue, const AtomicString& newValue) = 0; |
| 69 | 71 |
| 70 void enqueueUpgradeReaction(Element*); | 72 void enqueueUpgradeReaction(Element*); |
| 71 void enqueueConnectedCallback(Element*); | 73 void enqueueConnectedCallback(Element*); |
| 72 void enqueueDisconnectedCallback(Element*); | 74 void enqueueDisconnectedCallback(Element*); |
| 73 void enqueueAdoptedCallback(Element*); | 75 void enqueueAdoptedCallback( |
| 76 Element*, Document* oldOwner, Document* newOwner); |
| 74 void enqueueAttributeChangedCallback(Element*, const QualifiedName&, | 77 void enqueueAttributeChangedCallback(Element*, const QualifiedName&, |
| 75 const AtomicString& oldValue, const AtomicString& newValue); | 78 const AtomicString& oldValue, const AtomicString& newValue); |
| 76 | 79 |
| 77 class CORE_EXPORT ConstructionStackScope final { | 80 class CORE_EXPORT ConstructionStackScope final { |
| 78 STACK_ALLOCATED(); | 81 STACK_ALLOCATED(); |
| 79 DISALLOW_COPY_AND_ASSIGN(ConstructionStackScope); | 82 DISALLOW_COPY_AND_ASSIGN(ConstructionStackScope); |
| 80 public: | 83 public: |
| 81 ConstructionStackScope(CustomElementDefinition*, Element*); | 84 ConstructionStackScope(CustomElementDefinition*, Element*); |
| 82 ~ConstructionStackScope(); | 85 ~ConstructionStackScope(); |
| 83 | 86 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 96 ConstructionStack m_constructionStack; | 99 ConstructionStack m_constructionStack; |
| 97 HashSet<AtomicString> m_observedAttributes; | 100 HashSet<AtomicString> m_observedAttributes; |
| 98 bool m_hasStyleAttributeChangedCallback; | 101 bool m_hasStyleAttributeChangedCallback; |
| 99 | 102 |
| 100 void enqueueAttributeChangedCallbackForAllAttributes(Element*); | 103 void enqueueAttributeChangedCallbackForAllAttributes(Element*); |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 } // namespace blink | 106 } // namespace blink |
| 104 | 107 |
| 105 #endif // CustomElementDefinition_h | 108 #endif // CustomElementDefinition_h |
| OLD | NEW |