| 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/CustomElementReactionQueue.h" | 5 #include "core/dom/custom/CustomElementReactionQueue.h" |
| 6 | 6 |
| 7 #include "core/dom/custom/CustomElementReaction.h" | 7 #include "core/dom/custom/CustomElementReaction.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 void CustomElementReactionQueue::invokeReactions(Element* element) { | 25 void CustomElementReactionQueue::invokeReactions(Element* element) { |
| 26 while (m_index < m_reactions.size()) { | 26 while (m_index < m_reactions.size()) { |
| 27 CustomElementReaction* reaction = m_reactions[m_index]; | 27 CustomElementReaction* reaction = m_reactions[m_index]; |
| 28 m_reactions[m_index++] = nullptr; | 28 m_reactions[m_index++] = nullptr; |
| 29 reaction->invoke(element); | 29 reaction->invoke(element); |
| 30 } | 30 } |
| 31 // Unlike V0CustomElementsCallbackQueue, reactions are always | 31 // Unlike V0CustomElementsCallbackQueue, reactions are always |
| 32 // inserted by steps which bump the global element queue. This | 32 // inserted by steps which bump the global element queue. This |
| 33 // means we do not need queue "owner" guards. | 33 // means we do not need queue "owner" guards. |
| 34 // https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reacti
ons | 34 // https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reacti
ons |
| 35 clear(); |
| 36 } |
| 37 |
| 38 void CustomElementReactionQueue::clear() { |
| 35 m_index = 0; | 39 m_index = 0; |
| 36 m_reactions.resize(0); | 40 m_reactions.resize(0); |
| 37 } | 41 } |
| 38 | 42 |
| 39 } // namespace blink | 43 } // namespace blink |
| OLD | NEW |