| 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 CustomElementTestHelpers_h | 5 #ifndef CustomElementTestHelpers_h |
| 6 #define CustomElementTestHelpers_h | 6 #define CustomElementTestHelpers_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 TestCustomElementDefinition(const CustomElementDescriptor& descriptor, | 48 TestCustomElementDefinition(const CustomElementDescriptor& descriptor, |
| 49 const HashSet<AtomicString>& observedAttributes) | 49 const HashSet<AtomicString>& observedAttributes) |
| 50 : CustomElementDefinition(descriptor, observedAttributes) {} | 50 : CustomElementDefinition(descriptor, observedAttributes) {} |
| 51 | 51 |
| 52 ~TestCustomElementDefinition() override = default; | 52 ~TestCustomElementDefinition() override = default; |
| 53 | 53 |
| 54 ScriptValue getConstructorForScript() override { return ScriptValue(); } | 54 ScriptValue getConstructorForScript() override { return ScriptValue(); } |
| 55 | 55 |
| 56 bool runConstructor(Element* element) override { | 56 bool runConstructor(Element* element) override { |
| 57 if (constructionStack().isEmpty() || constructionStack().last() != element) | 57 if (constructionStack().isEmpty() || constructionStack().back() != element) |
| 58 return false; | 58 return false; |
| 59 constructionStack().last().clear(); | 59 constructionStack().back().clear(); |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 HTMLElement* createElementSync(Document& document, | 63 HTMLElement* createElementSync(Document& document, |
| 64 const QualifiedName&) override { | 64 const QualifiedName&) override { |
| 65 return createElementForConstructor(document); | 65 return createElementForConstructor(document); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool hasConnectedCallback() const override { return false; } | 68 bool hasConnectedCallback() const override { return false; } |
| 69 bool hasDisconnectedCallback() const override { return false; } | 69 bool hasDisconnectedCallback() const override { return false; } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 private: | 132 private: |
| 133 Member<Document> m_document; | 133 Member<Document> m_document; |
| 134 AtomicString m_namespaceURI; | 134 AtomicString m_namespaceURI; |
| 135 AtomicString m_localName; | 135 AtomicString m_localName; |
| 136 std::vector<std::pair<QualifiedName, AtomicString>> m_attributes; | 136 std::vector<std::pair<QualifiedName, AtomicString>> m_attributes; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| 140 | 140 |
| 141 #endif // CustomElementTestHelpers_h | 141 #endif // CustomElementTestHelpers_h |
| OLD | NEW |