| 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/CustomElementReactionStack.h" | 5 #include "core/dom/custom/CustomElementReactionStack.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Microtask.h" | 7 #include "bindings/core/v8/Microtask.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/dom/custom/CEReactionsScope.h" | 9 #include "core/dom/custom/CEReactionsScope.h" |
| 10 #include "core/dom/custom/CustomElementReactionQueue.h" | 10 #include "core/dom/custom/CustomElementReactionQueue.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void CustomElementReactionStack::enqueue(Member<ElementQueue>& queue, | 71 void CustomElementReactionStack::enqueue(Member<ElementQueue>& queue, |
| 72 Element* element, | 72 Element* element, |
| 73 CustomElementReaction* reaction) { | 73 CustomElementReaction* reaction) { |
| 74 if (!queue) | 74 if (!queue) |
| 75 queue = new ElementQueue(); | 75 queue = new ElementQueue(); |
| 76 queue->push_back(element); | 76 queue->push_back(element); |
| 77 | 77 |
| 78 CustomElementReactionQueue* reactions = m_map.get(element); | 78 CustomElementReactionQueue* reactions = m_map.get(element); |
| 79 if (!reactions) { | 79 if (!reactions) { |
| 80 reactions = new CustomElementReactionQueue(); | 80 reactions = new CustomElementReactionQueue(); |
| 81 m_map.add(TraceWrapperMember<Element>(this, element), reactions); | 81 m_map.insert(TraceWrapperMember<Element>(this, element), reactions); |
| 82 } | 82 } |
| 83 | 83 |
| 84 reactions->add(reaction); | 84 reactions->add(reaction); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void CustomElementReactionStack::enqueueToBackupQueue( | 87 void CustomElementReactionStack::enqueueToBackupQueue( |
| 88 Element* element, | 88 Element* element, |
| 89 CustomElementReaction* reaction) { | 89 CustomElementReaction* reaction) { |
| 90 // https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue | 90 // https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue |
| 91 | 91 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 121 CustomElementReactionStack* | 121 CustomElementReactionStack* |
| 122 CustomElementReactionStackTestSupport::setCurrentForTest( | 122 CustomElementReactionStackTestSupport::setCurrentForTest( |
| 123 CustomElementReactionStack* newStack) { | 123 CustomElementReactionStack* newStack) { |
| 124 Persistent<CustomElementReactionStack>& stack = customElementReactionStack(); | 124 Persistent<CustomElementReactionStack>& stack = customElementReactionStack(); |
| 125 CustomElementReactionStack* oldStack = stack.get(); | 125 CustomElementReactionStack* oldStack = stack.get(); |
| 126 stack = newStack; | 126 stack = newStack; |
| 127 return oldStack; | 127 return oldStack; |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| OLD | NEW |