| Index: third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp
|
| index e7c473c234e6894c600c2053d00d979fc729e5ee..60515bd1d48bdc217d27858be7d0071646018184 100644
|
| --- a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp
|
| @@ -14,8 +14,9 @@ namespace blink {
|
|
|
| namespace {
|
|
|
| -CustomElementReactionStack& customElementReactionStack() {
|
| - DEFINE_STATIC_LOCAL(CustomElementReactionStack, customElementReactionStack,
|
| +Persistent<CustomElementReactionStack>& customElementReactionStack() {
|
| + DEFINE_STATIC_LOCAL(Persistent<CustomElementReactionStack>,
|
| + customElementReactionStack,
|
| (new CustomElementReactionStack));
|
| return customElementReactionStack;
|
| }
|
| @@ -96,6 +97,11 @@ void CustomElementReactionStack::enqueueToBackupQueue(
|
| enqueue(m_backupQueue, element, reaction);
|
| }
|
|
|
| +void CustomElementReactionStack::clearQueue(Element* element) {
|
| + if (CustomElementReactionQueue* reactions = m_map.get(element))
|
| + reactions->clear();
|
| +}
|
| +
|
| void CustomElementReactionStack::invokeBackupQueue() {
|
| DCHECK(isMainThread());
|
| invokeReactions(*m_backupQueue);
|
| @@ -103,7 +109,16 @@ void CustomElementReactionStack::invokeBackupQueue() {
|
| }
|
|
|
| CustomElementReactionStack& CustomElementReactionStack::current() {
|
| - return customElementReactionStack();
|
| + return *customElementReactionStack();
|
| +}
|
| +
|
| +CustomElementReactionStack*
|
| +CustomElementReactionStackTestSupport::setCurrentForTest(
|
| + CustomElementReactionStack* newStack) {
|
| + Persistent<CustomElementReactionStack>& stack = customElementReactionStack();
|
| + CustomElementReactionStack* oldStack = stack.get();
|
| + stack = newStack;
|
| + return oldStack;
|
| }
|
|
|
| } // namespace blink
|
|
|