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

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

Issue 2456773002: Clear the custom element's reaction queue if upgrade fails. (Closed)
Patch Set: Created 4 years, 1 month 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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698