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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h

Issue 2027513002: Add a stack of queues of elements with reaction queues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ce-element-queue
Patch Set: Rebase. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h
new file mode 100644
index 0000000000000000000000000000000000000000..f906b78d6b19ccf915c9cb9097c3ce9c6d789990
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CustomElementReactionStack_h
+#define CustomElementReactionStack_h
+
+#include "core/CoreExport.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class CustomElementReaction;
+class CustomElementReactionQueue;
+class Element;
+
+// https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reactions
+class CORE_EXPORT CustomElementReactionStack final
+ : public GarbageCollectedFinalized<CustomElementReactionStack> {
+ WTF_MAKE_NONCOPYABLE(CustomElementReactionStack);
+public:
+ CustomElementReactionStack();
+ ~CustomElementReactionStack();
+
+ DECLARE_TRACE();
+
+ void push();
+ void popInvokingReactions();
+ void enqueue(Element*, CustomElementReaction*);
+
+private:
+ using ElementReactionQueueMap =
+ HeapHashMap<Member<Element>, Member<CustomElementReactionQueue>>;
+ ElementReactionQueueMap m_map;
+
+ using ElementQueue = HeapVector<Member<Element>, 1>;
+ HeapVector<Member<ElementQueue>> m_stack;
+};
+
+} // namespace blink
+
+#endif // CustomElementReactionStack_h

Powered by Google App Engine
This is Rietveld 408576698