| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 // Pop the construction stack. | 117 // Pop the construction stack. |
| 118 if (m_constructionStack.last().get()) | 118 if (m_constructionStack.last().get()) |
| 119 DCHECK_EQ(m_constructionStack.last(), element); | 119 DCHECK_EQ(m_constructionStack.last(), element); |
| 120 DCHECK_EQ(m_constructionStack.size(), depth); // It's a *stack*. | 120 DCHECK_EQ(m_constructionStack.size(), depth); // It's a *stack*. |
| 121 m_constructionStack.removeLast(); | 121 m_constructionStack.removeLast(); |
| 122 | 122 |
| 123 if (!succeeded) | 123 if (!succeeded) |
| 124 return; | 124 return; |
| 125 | 125 |
| 126 CHECK(element->getCustomElementState() == CustomElementState::Custom); | 126 element->setCustomElementState(CustomElementState::Custom); |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool CustomElementDefinition::hasAttributeChangedCallback( | 129 bool CustomElementDefinition::hasAttributeChangedCallback( |
| 130 const QualifiedName& name) | 130 const QualifiedName& name) |
| 131 { | 131 { |
| 132 return m_observedAttributes.contains(name.localName()); | 132 return m_observedAttributes.contains(name.localName()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CustomElementDefinition::enqueueUpgradeReaction(Element* element) | 135 void CustomElementDefinition::enqueueUpgradeReaction(Element* element) |
| 136 { | 136 { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 element->synchronizeAttribute(name); | 169 element->synchronizeAttribute(name); |
| 170 for (const auto& attribute : element->attributesWithoutUpdate()) { | 170 for (const auto& attribute : element->attributesWithoutUpdate()) { |
| 171 if (hasAttributeChangedCallback(attribute.name())) { | 171 if (hasAttributeChangedCallback(attribute.name())) { |
| 172 enqueueAttributeChangedCallback(element, attribute.name(), | 172 enqueueAttributeChangedCallback(element, attribute.name(), |
| 173 nullAtom, attribute.value()); | 173 nullAtom, attribute.value()); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |