| 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 #include "core/dom/custom/CustomElementDefinition.h" | 5 #include "core/dom/custom/CustomElementDefinition.h" |
| 6 | 6 |
| 7 #include "core/dom/Attr.h" | 7 #include "core/dom/Attr.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "core/dom/custom/CustomElement.h" | 9 #include "core/dom/custom/CustomElement.h" |
| 10 #include "core/dom/custom/CustomElementAttributeChangedCallbackReaction.h" | 10 #include "core/dom/custom/CustomElementAttributeChangedCallbackReaction.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (m_constructionStack.last().get()) | 120 if (m_constructionStack.last().get()) |
| 121 DCHECK_EQ(m_constructionStack.last(), element); | 121 DCHECK_EQ(m_constructionStack.last(), element); |
| 122 DCHECK_EQ(m_constructionStack.size(), depth); // It's a *stack*. | 122 DCHECK_EQ(m_constructionStack.size(), depth); // It's a *stack*. |
| 123 m_constructionStack.removeLast(); | 123 m_constructionStack.removeLast(); |
| 124 | 124 |
| 125 if (!succeeded) { | 125 if (!succeeded) { |
| 126 element->setCustomElementState(CustomElementState::Failed); | 126 element->setCustomElementState(CustomElementState::Failed); |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 | 129 |
| 130 CHECK(element->getCustomElementState() == CustomElementState::Custom); | 130 element->setCustomElementState(CustomElementState::Custom); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool CustomElementDefinition::hasAttributeChangedCallback( | 133 bool CustomElementDefinition::hasAttributeChangedCallback( |
| 134 const QualifiedName& name) const | 134 const QualifiedName& name) const |
| 135 { | 135 { |
| 136 return m_observedAttributes.contains(name.localName()); | 136 return m_observedAttributes.contains(name.localName()); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool CustomElementDefinition::hasStyleAttributeChangedCallback() const | 139 bool CustomElementDefinition::hasStyleAttributeChangedCallback() const |
| 140 { | 140 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 element->synchronizeAttribute(name); | 178 element->synchronizeAttribute(name); |
| 179 for (const auto& attribute : element->attributesWithoutUpdate()) { | 179 for (const auto& attribute : element->attributesWithoutUpdate()) { |
| 180 if (hasAttributeChangedCallback(attribute.name())) { | 180 if (hasAttributeChangedCallback(attribute.name())) { |
| 181 enqueueAttributeChangedCallback(element, attribute.name(), | 181 enqueueAttributeChangedCallback(element, attribute.name(), |
| 182 nullAtom, attribute.value()); | 182 nullAtom, attribute.value()); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace blink | 187 } // namespace blink |
| OLD | NEW |