Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp

Issue 2161003002: CustomElements: upgrade element patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upgrade-element
Patch Set: workflow commit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // CHECK(element->getCustomElementState() == CustomElementState::Custom);
dominicc (has gone to gerrit) 2016/07/22 07:34:08 Delete this line.
127 } 128 }
128 129
129 bool CustomElementDefinition::hasAttributeChangedCallback( 130 bool CustomElementDefinition::hasAttributeChangedCallback(
130 const QualifiedName& name) 131 const QualifiedName& name)
131 { 132 {
132 return m_observedAttributes.contains(name.localName()); 133 return m_observedAttributes.contains(name.localName());
133 } 134 }
134 135
135 void CustomElementDefinition::enqueueUpgradeReaction(Element* element) 136 void CustomElementDefinition::enqueueUpgradeReaction(Element* element)
136 { 137 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 element->synchronizeAttribute(name); 170 element->synchronizeAttribute(name);
170 for (const auto& attribute : element->attributesWithoutUpdate()) { 171 for (const auto& attribute : element->attributesWithoutUpdate()) {
171 if (hasAttributeChangedCallback(attribute.name())) { 172 if (hasAttributeChangedCallback(attribute.name())) {
172 enqueueAttributeChangedCallback(element, attribute.name(), 173 enqueueAttributeChangedCallback(element, attribute.name(),
173 nullAtom, attribute.value()); 174 nullAtom, attribute.value());
174 } 175 }
175 } 176 }
176 } 177 }
177 178
178 } // namespace blink 179 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698