Title: [204652] trunk/Source/WebCore
Revision
204652
Author
[email protected]
Date
2016-08-19 14:02:31 -0700 (Fri, 19 Aug 2016)

Log Message

Rename LifecycleCallback to CustomElementReaction
https://bugs.webkit.org/show_bug.cgi?id=160991

Reviewed by Chris Dumez.

Renamed LifecycleCallbackQueue and CustomElementLifecycleProcessingStack
to CustomElementReactionQueue and CustomElementReactionStack per the latest spec:
https://html.spec.whatwg.org/#custom-element-reactions

No new tests since this is just a rename of classes which are not exposed to the Web.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* bindings/js/JSCustomElementsRegistryCustom.cpp:
(WebCore::getCallback): Renamed from getLifecycleCallback.
(WebCore::JSCustomElementsRegistry::define):
(WebCore::getLifecycleCallback): Deleted.

* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadNullState):

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

* bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
* bindings/scripts/test/TestObj.idl:

* dom/CustomElementReactionQueue.cpp: Moved from Source/WebCore/dom/LifecycleCallbackQueue.cpp.
(WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
(WebCore::CustomElementReactionQueue::CustomElementReactionQueue):
(WebCore::CustomElementReactionQueue::~CustomElementReactionQueue):
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::invokeAll):
(WebCore::CustomElementReactionStack::ensureCurrentQueue):
(WebCore::CustomElementReactionStack::processQueue):

* dom/CustomElementReactionQueue.h: Moved from Source/WebCore/dom/LifecycleCallbackQueue.h.
(WebCore::CustomElementReactionStack::CustomElementReactionStack):
(WebCore::CustomElementReactionStack::~CustomElementReactionStack):
(WebCore::CustomElementReactionStack::hasCurrentProcessingStack):

* dom/Document.cpp:
(WebCore::createFallbackHTMLElement):

* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (204651 => 204652)


--- trunk/Source/WebCore/CMakeLists.txt	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-08-19 21:02:31 UTC (rev 204652)
@@ -1438,6 +1438,7 @@
     dom/ContainerNode.cpp
     dom/ContainerNodeAlgorithms.cpp
     dom/ContextDestructionObserver.cpp
+    dom/CustomElementReactionQueue.cpp
     dom/CustomElementsRegistry.cpp
     dom/CustomEvent.cpp
     dom/DOMCoreException.cpp
@@ -1484,7 +1485,6 @@
     dom/IdTargetObserverRegistry.cpp
     dom/InlineStyleSheetOwner.cpp
     dom/KeyboardEvent.cpp
-    dom/LifecycleCallbackQueue.cpp
     dom/LiveNodeList.cpp
     dom/MessageChannel.cpp
     dom/MessageEvent.cpp

Modified: trunk/Source/WebCore/ChangeLog (204651 => 204652)


--- trunk/Source/WebCore/ChangeLog	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/ChangeLog	2016-08-19 21:02:31 UTC (rev 204652)
@@ -1,3 +1,58 @@
+2016-08-18  Ryosuke Niwa  <[email protected]>
+
+        Rename LifecycleCallback to CustomElementReaction
+        https://bugs.webkit.org/show_bug.cgi?id=160991
+
+        Reviewed by Chris Dumez.
+
+        Renamed LifecycleCallbackQueue and CustomElementLifecycleProcessingStack
+        to CustomElementReactionQueue and CustomElementReactionStack per the latest spec:
+        https://html.spec.whatwg.org/#custom-element-reactions
+
+        No new tests since this is just a rename of classes which are not exposed to the Web.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * bindings/js/JSCustomElementsRegistryCustom.cpp:
+        (WebCore::getCallback): Renamed from getLifecycleCallback.
+        (WebCore::JSCustomElementsRegistry::define):
+        (WebCore::getLifecycleCallback): Deleted.
+
+        * bindings/js/JSMainThreadExecState.h:
+        (WebCore::JSMainThreadNullState):
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+
+        * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
+        * bindings/scripts/test/TestObj.idl:
+
+        * dom/CustomElementReactionQueue.cpp: Moved from Source/WebCore/dom/LifecycleCallbackQueue.cpp.
+        (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
+        (WebCore::CustomElementReactionQueue::CustomElementReactionQueue):
+        (WebCore::CustomElementReactionQueue::~CustomElementReactionQueue):
+        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
+        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
+        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
+        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
+        (WebCore::CustomElementReactionQueue::invokeAll):
+        (WebCore::CustomElementReactionStack::ensureCurrentQueue):
+        (WebCore::CustomElementReactionStack::processQueue):
+
+        * dom/CustomElementReactionQueue.h: Moved from Source/WebCore/dom/LifecycleCallbackQueue.h.
+        (WebCore::CustomElementReactionStack::CustomElementReactionStack):
+        (WebCore::CustomElementReactionStack::~CustomElementReactionStack):
+        (WebCore::CustomElementReactionStack::hasCurrentProcessingStack):
+
+        * dom/Document.cpp:
+        (WebCore::createFallbackHTMLElement):
+
+        * dom/Element.cpp:
+        (WebCore::Element::attributeChanged):
+        (WebCore::Element::insertedInto):
+        (WebCore::Element::removedFrom):
+
 2016-08-19  Chris Dumez  <[email protected]>
 
         Attr.prefix / Element.prefix attribute should be readonly

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204651 => 204652)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-19 21:02:31 UTC (rev 204652)
@@ -3930,7 +3930,7 @@
 		9B532EA31BA928570038A827 /* SlotAssignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B532EA11BA928570038A827 /* SlotAssignment.cpp */; };
 		9B532EA41BA928570038A827 /* SlotAssignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B532EA21BA928570038A827 /* SlotAssignment.h */; };
 		9B55EEE91B3E8898005342BC /* EditorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */; };
-		9B56C9AA1C89329A00C456DF /* LifecycleCallbackQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */; };
+		9B56C9AA1C89329A00C456DF /* CustomElementReactionQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */; };
 		9B69D3B41B98FFE900E3512B /* HTMLSlotElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B69D3B21B98FFE900E3512B /* HTMLSlotElement.cpp */; };
 		9B69D3B51B98FFE900E3512B /* HTMLSlotElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B69D3B31B98FFE900E3512B /* HTMLSlotElement.h */; };
 		9B69D3B81B99100700E3512B /* JSHTMLSlotElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B69D3B61B99100700E3512B /* JSHTMLSlotElement.cpp */; };
@@ -11515,8 +11515,8 @@
 		9B532EA11BA928570038A827 /* SlotAssignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotAssignment.cpp; sourceTree = "<group>"; };
 		9B532EA21BA928570038A827 /* SlotAssignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotAssignment.h; sourceTree = "<group>"; };
 		9B55EEE81B3E8898005342BC /* EditorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorCocoa.mm; sourceTree = "<group>"; };
-		9B56C9A81C89312800C456DF /* LifecycleCallbackQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LifecycleCallbackQueue.h; sourceTree = "<group>"; };
-		9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LifecycleCallbackQueue.cpp; sourceTree = "<group>"; };
+		9B56C9A81C89312800C456DF /* CustomElementReactionQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomElementReactionQueue.h; sourceTree = "<group>"; };
+		9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomElementReactionQueue.cpp; sourceTree = "<group>"; };
 		9B69D3B11B98FF0A00E3512B /* HTMLSlotElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLSlotElement.idl; sourceTree = "<group>"; };
 		9B69D3B21B98FFE900E3512B /* HTMLSlotElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLSlotElement.cpp; sourceTree = "<group>"; };
 		9B69D3B31B98FFE900E3512B /* HTMLSlotElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLSlotElement.h; sourceTree = "<group>"; };
@@ -23998,6 +23998,8 @@
 				9BD4E9181C462CFC005065BC /* CustomElementsRegistry.cpp */,
 				9BD4E9191C462CFC005065BC /* CustomElementsRegistry.h */,
 				9BC5F9DE1D5AAD5D002B749D /* CustomElementsRegistry.idl */,
+				9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */,
+				9B56C9A81C89312800C456DF /* CustomElementReactionQueue.h */,
 				62CD32561157E57C0063B0A7 /* CustomEvent.cpp */,
 				62CD32571157E57C0063B0A7 /* CustomEvent.h */,
 				62CD32581157E57C0063B0A7 /* CustomEvent.idl */,
@@ -24137,8 +24139,6 @@
 				85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
 				85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */,
 				14CF7C2009F7110600EB3665 /* KeyboardEvent.idl */,
-				9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */,
-				9B56C9A81C89312800C456DF /* LifecycleCallbackQueue.h */,
 				BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */,
 				BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */,
 				BC9A6144146859D9006057FD /* make_dom_exceptions.pl */,
@@ -30576,7 +30576,7 @@
 				E55F497A151B888000BB67DB /* LengthFunctions.cpp in Sources */,
 				0F87166F1C869D83004FF0DE /* LengthPoint.cpp in Sources */,
 				0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */,
-				9B56C9AA1C89329A00C456DF /* LifecycleCallbackQueue.cpp in Sources */,
+				9B56C9AA1C89329A00C456DF /* CustomElementReactionQueue.cpp in Sources */,
 				FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
 				89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
 				FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/JSCustomElementsRegistryCustom.cpp (204651 => 204652)


--- trunk/Source/WebCore/bindings/js/JSCustomElementsRegistryCustom.cpp	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/bindings/js/JSCustomElementsRegistryCustom.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -39,7 +39,7 @@
 
 #if ENABLE(CUSTOM_ELEMENTS)
 
-static JSObject* getLifecycleCallback(ExecState& state, JSObject& prototype, const Identifier& id)
+static JSObject* getCustomElementCallback(ExecState& state, JSObject& prototype, const Identifier& id)
 {
     JSValue callback = prototype.get(&state, id);
     if (state.hadException())
@@ -47,7 +47,7 @@
     if (callback.isUndefined())
         return nullptr;
     if (!callback.isFunction()) {
-        throwTypeError(&state, ASCIILiteral("A lifecycle callback must be a function"));
+        throwTypeError(&state, ASCIILiteral("A custom element callback must be a function"));
         return nullptr;
     }
     return callback.getObject();
@@ -107,13 +107,13 @@
     QualifiedName name(nullAtom, localName, HTMLNames::xhtmlNamespaceURI);
     auto elementInterface = JSCustomElementInterface::create(name, constructor, globalObject());
 
-    auto* connectedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "connectedCallback"));
+    auto* connectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "connectedCallback"));
     if (state.hadException())
         return jsUndefined();
     if (connectedCallback)
         elementInterface->setConnectedCallback(connectedCallback);
 
-    auto* disconnectedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "disconnectedCallback"));
+    auto* disconnectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "disconnectedCallback"));
     if (state.hadException())
         return jsUndefined();
     if (disconnectedCallback)
@@ -120,11 +120,11 @@
         elementInterface->setDisconnectedCallback(disconnectedCallback);
 
     // FIXME: Add the support for adoptedCallback.
-    getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "adoptedCallback"));
+    getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "adoptedCallback"));
     if (state.hadException())
         return jsUndefined();
 
-    auto* attributeChangedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "attributeChangedCallback"));
+    auto* attributeChangedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "attributeChangedCallback"));
     if (state.hadException())
         return jsUndefined();
     if (attributeChangedCallback) {

Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (204651 => 204652)


--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h	2016-08-19 21:02:31 UTC (rev 204652)
@@ -26,8 +26,8 @@
 #ifndef JSMainThreadExecState_h
 #define JSMainThreadExecState_h
 
+#include "CustomElementReactionQueue.h"
 #include "JSDOMBinding.h"
-#include "LifecycleCallbackQueue.h"
 #include <runtime/Completion.h>
 #include <runtime/Microtask.h>
 #include <wtf/MainThread.h>
@@ -148,7 +148,7 @@
 private:
     JSC::ExecState* m_previousState;
 #if ENABLE(CUSTOM_ELEMENTS)
-    CustomElementLifecycleProcessingStack m_lifecycleProcessingStack;
+    CustomElementReactionStack m_customElementReactionStack;
 #endif
 };
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (204651 => 204652)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-08-19 21:02:31 UTC (rev 204652)
@@ -3342,9 +3342,9 @@
 
             if ($function->signature->extendedAttributes->{"CEReactions"}) {
                 push(@implContent, "#if ENABLE(CUSTOM_ELEMENTS)\n");
-                push(@implContent, "    CustomElementLifecycleProcessingStack customElementLifecycleProcessingStack;\n");
+                push(@implContent, "    CustomElementReactionStack customElementReactionStack;\n");
                 push(@implContent, "#endif\n");
-                $implIncludes{"LifecycleCallbackQueue.h"} = 1;
+                $implIncludes{"CustomElementReactionQueue.h"} = 1;
             }
 
             if ($function->isStatic) {

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (204651 => 204652)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -22,6 +22,7 @@
 #include "JSTestObj.h"
 
 #include "CallbackFunction.h"
+#include "CustomElementReactionQueue.h"
 #include "DOMStringList.h"
 #include "Dictionary.h"
 #include "Document.h"
@@ -49,7 +50,6 @@
 #include "JSTestObj.h"
 #include "JSTestSubObj.h"
 #include "JSXPathNSResolver.h"
-#include "LifecycleCallbackQueue.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SVGDocument.h"
 #include "SVGPoint.h"
@@ -724,7 +724,7 @@
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseOverloadedFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot(JSC::ExecState*);
 
 // Attributes
@@ -1311,7 +1311,7 @@
     { "testPromiseFunctionWithException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithException), (intptr_t) (0) } },
     { "testPromiseFunctionWithOptionalIntArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
     { "testPromiseOverloadedFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseOverloadedFunction), (intptr_t) (1) } },
-    { "methodWithNeedsLifecycleProcessingStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack), (intptr_t) (0) } },
+    { "methodWithNeedsCustomElementReactionStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack), (intptr_t) (0) } },
     { "attachShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAttachShadowRoot), (intptr_t) (1) } },
 #if ENABLE(Condition1)
     { "CONDITIONAL_CONST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
@@ -6376,18 +6376,18 @@
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack(ExecState* state)
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(ExecState* state)
 {
 #if ENABLE(CUSTOM_ELEMENTS)
-    CustomElementLifecycleProcessingStack customElementLifecycleProcessingStack;
+    CustomElementReactionStack customElementReactionStack;
 #endif
     JSValue thisValue = state->thisValue();
     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, "TestObject", "methodWithNeedsLifecycleProcessingStack");
+        return throwThisTypeError(*state, "TestObject", "methodWithNeedsCustomElementReactionStack");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
-    impl.methodWithNeedsLifecycleProcessingStack();
+    impl.methodWithNeedsCustomElementReactionStack();
     return JSValue::encode(jsUndefined());
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (204651 => 204652)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-08-19 21:02:31 UTC (rev 204652)
@@ -390,7 +390,7 @@
     [PutForwards=name] readonly attribute TestNode? putForwardsNullableAttribute;
 
 #if defined(TESTING_JS)
-    [CEReactions] void methodWithNeedsLifecycleProcessingStack();
+    [CEReactions] void methodWithNeedsCustomElementReactionStack();
 #endif
 
     void attachShadowRoot(TestDictionary init);

Copied: trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp (from rev 204651, trunk/Source/WebCore/dom/LifecycleCallbackQueue.cpp) (0 => 204652)


--- trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp	                        (rev 0)
+++ trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CustomElementReactionQueue.h"
+
+#if ENABLE(CUSTOM_ELEMENTS)
+
+#include "CustomElementsRegistry.h"
+#include "DOMWindow.h"
+#include "Document.h"
+#include "Element.h"
+#include "JSCustomElementInterface.h"
+#include "JSDOMBinding.h"
+#include <heap/Heap.h>
+#include <wtf/Optional.h>
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class CustomElementReactionQueueItem {
+public:
+    enum class Type {
+        ElementUpgrade,
+        Connected,
+        Disconnected,
+        AttributeChanged,
+    };
+
+    CustomElementReactionQueueItem(Type type, Element& element, JSCustomElementInterface& elementInterface)
+        : m_type(type)
+        , m_element(element)
+        , m_interface(elementInterface)
+    { }
+
+    CustomElementReactionQueueItem(Element& element, JSCustomElementInterface& elementInterface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
+        : m_type(Type::AttributeChanged)
+        , m_element(element)
+        , m_interface(elementInterface)
+        , m_attributeName(attributeName)
+        , m_oldValue(oldValue)
+        , m_newValue(newValue)
+    { }
+
+    void invoke()
+    {
+        switch (m_type) {
+        case Type::ElementUpgrade:
+            m_interface->upgradeElement(m_element.get());
+            break;
+        case Type::Connected:
+            m_interface->invokeConnectedCallback(m_element.get());
+            break;
+        case Type::Disconnected:
+            m_interface->invokeDisconnectedCallback(m_element.get());
+            break;
+        case Type::AttributeChanged:
+            ASSERT(m_attributeName);
+            m_interface->invokeAttributeChangedCallback(m_element.get(), m_attributeName.value(), m_oldValue, m_newValue);
+            break;
+        }
+    }
+
+private:
+    Type m_type;
+    Ref<Element> m_element;
+    Ref<JSCustomElementInterface> m_interface;
+    Optional<QualifiedName> m_attributeName;
+    AtomicString m_oldValue;
+    AtomicString m_newValue;
+};
+
+CustomElementReactionQueue::CustomElementReactionQueue()
+{ }
+
+CustomElementReactionQueue::~CustomElementReactionQueue()
+{
+    ASSERT(m_items.isEmpty());
+}
+
+void CustomElementReactionQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& elementInterface)
+{
+    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
+        queue->m_items.append({CustomElementReactionQueueItem::Type::ElementUpgrade, element, elementInterface});
+}
+
+static JSCustomElementInterface* findInterfaceForCustomElement(Element& element)
+{
+    ASSERT(element.isCustomElement());
+    auto* window = element.document().domWindow();
+    if (!window)
+        return nullptr;
+
+    auto* registry = window->customElementsRegistry();
+    if (!registry)
+        return nullptr;
+
+    return registry->findInterface(element.tagQName());
+}
+
+void CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded(Element& element)
+{
+    auto* elementInterface = findInterfaceForCustomElement(element);
+    if (!elementInterface)
+        return;
+
+    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
+        queue->m_items.append({CustomElementReactionQueueItem::Type::Connected, element, *elementInterface});
+}
+
+void CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded(Element& element)
+{
+    auto* elementInterface = findInterfaceForCustomElement(element);
+    if (!elementInterface)
+        return;
+
+    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
+        queue->m_items.append({CustomElementReactionQueueItem::Type::Disconnected, element, *elementInterface});
+}
+
+void CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded(Element& element, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
+{
+    auto* elementInterface = findInterfaceForCustomElement(element);
+    if (!elementInterface || !elementInterface->observesAttribute(attributeName.localName()))
+        return;
+
+    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
+        queue->m_items.append({element, *elementInterface, attributeName, oldValue, newValue});
+}
+
+void CustomElementReactionQueue::invokeAll()
+{
+    Vector<CustomElementReactionQueueItem> items;
+    items.swap(m_items);
+    for (auto& item : items)
+        item.invoke();
+}
+
+CustomElementReactionQueue* CustomElementReactionStack::ensureCurrentQueue()
+{
+    // FIXME: This early exit indicates a bug that some DOM API is missing CEReactions
+    if (!s_currentProcessingStack)
+        return nullptr;
+
+    auto*& queue = s_currentProcessingStack->m_queue;
+    if (!queue) // We use a raw pointer to avoid genearing code to delete it in ~CustomElementReactionStack.
+        queue = new CustomElementReactionQueue;
+    return queue;
+}
+
+CustomElementReactionStack* CustomElementReactionStack::s_currentProcessingStack = nullptr;
+
+void CustomElementReactionStack::processQueue()
+{
+    ASSERT(m_queue);
+    m_queue->invokeAll();
+    delete m_queue;
+    m_queue = nullptr;
+}
+
+}
+
+#endif

Copied: trunk/Source/WebCore/dom/CustomElementReactionQueue.h (from rev 204651, trunk/Source/WebCore/dom/LifecycleCallbackQueue.h) (0 => 204652)


--- trunk/Source/WebCore/dom/CustomElementReactionQueue.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/CustomElementReactionQueue.h	2016-08-19 21:02:31 UTC (rev 204652)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(CUSTOM_ELEMENTS)
+
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class JSCustomElementInterface;
+class Document;
+class Element;
+class CustomElementReactionQueueItem;
+class QualifiedName;
+
+class CustomElementReactionQueue {
+    WTF_MAKE_NONCOPYABLE(CustomElementReactionQueue);
+public:
+    CustomElementReactionQueue();
+    ~CustomElementReactionQueue();
+
+    static void enqueueElementUpgrade(Element&, JSCustomElementInterface&);
+    static void enqueueConnectedCallbackIfNeeded(Element&);
+    static void enqueueDisconnectedCallbackIfNeeded(Element&);
+    static void enqueueAttributeChangedCallbackIfNeeded(Element&, const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue);
+
+    void invokeAll();
+
+private:
+    Vector<CustomElementReactionQueueItem> m_items;
+};
+
+class CustomElementReactionStack {
+public:
+    CustomElementReactionStack()
+        : m_previousProcessingStack(s_currentProcessingStack)
+    {
+        s_currentProcessingStack = this;
+    }
+
+    ~CustomElementReactionStack()
+    {
+        if (UNLIKELY(m_queue))
+            processQueue();
+        s_currentProcessingStack = m_previousProcessingStack;
+    }
+
+    // FIXME: This should be a reference once "ensure" starts to work.
+    static CustomElementReactionQueue* ensureCurrentQueue();
+
+    static bool hasCurrentProcessingStack() { return s_currentProcessingStack; }
+
+private:
+    void processQueue();
+
+    CustomElementReactionQueue* m_queue { nullptr };
+    CustomElementReactionStack* m_previousProcessingStack;
+
+    static CustomElementReactionStack* s_currentProcessingStack;
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/dom/Document.cpp (204651 => 204652)


--- trunk/Source/WebCore/dom/Document.cpp	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -44,6 +44,7 @@
 #include "CompositionEvent.h"
 #include "ContentSecurityPolicy.h"
 #include "CookieJar.h"
+#include "CustomElementReactionQueue.h"
 #include "CustomElementsRegistry.h"
 #include "CustomEvent.h"
 #include "DOMImplementation.h"
@@ -105,7 +106,6 @@
 #include "JSModuleLoader.h"
 #include "KeyboardEvent.h"
 #include "Language.h"
-#include "LifecycleCallbackQueue.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include "MainFrame.h"
@@ -1093,7 +1093,7 @@
             if (auto* elementInterface = registry->findInterface(name)) {
                 auto element = HTMLElement::create(name, document);
                 element->setIsUnresolvedCustomElement();
-                LifecycleCallbackQueue::enqueueElementUpgrade(element.get(), *elementInterface);
+                CustomElementReactionQueue::enqueueElementUpgrade(element.get(), *elementInterface);
                 return element;
             }
         }

Modified: trunk/Source/WebCore/dom/Element.cpp (204651 => 204652)


--- trunk/Source/WebCore/dom/Element.cpp	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/dom/Element.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -37,6 +37,7 @@
 #include "ClientRectList.h"
 #include "ComposedTreeAncestorIterator.h"
 #include "ContainerNodeAlgorithms.h"
+#include "CustomElementReactionQueue.h"
 #include "CustomElementsRegistry.h"
 #include "DOMTokenList.h"
 #include "Dictionary.h"
@@ -69,7 +70,6 @@
 #include "JSLazyEventListener.h"
 #include "KeyboardEvent.h"
 #include "KeyframeEffect.h"
-#include "LifecycleCallbackQueue.h"
 #include "MainFrame.h"
 #include "MutationObserverInterestGroup.h"
 #include "MutationRecord.h"
@@ -1293,7 +1293,7 @@
 
 #if ENABLE(CUSTOM_ELEMENTS)
     if (UNLIKELY(isCustomElement()))
-        LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded(*this, name, oldValue, newValue);
+        CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded(*this, name, oldValue, newValue);
 #endif
 
     if (valueIsSameAsBefore)
@@ -1598,7 +1598,7 @@
 
 #if ENABLE(CUSTOM_ELEMENTS)
     if (newDocument && UNLIKELY(isCustomElement()))
-        LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded(*this);
+        CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded(*this);
 #endif
 
     return InsertionDone;
@@ -1649,7 +1649,7 @@
 
 #if ENABLE(CUSTOM_ELEMENTS)
         if (oldDocument && UNLIKELY(isCustomElement()))
-            LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded(*this);
+            CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded(*this);
 #endif
     }
 

Deleted: trunk/Source/WebCore/dom/LifecycleCallbackQueue.cpp (204651 => 204652)


--- trunk/Source/WebCore/dom/LifecycleCallbackQueue.cpp	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/dom/LifecycleCallbackQueue.cpp	2016-08-19 21:02:31 UTC (rev 204652)
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LifecycleCallbackQueue.h"
-
-#if ENABLE(CUSTOM_ELEMENTS)
-
-#include "CustomElementsRegistry.h"
-#include "DOMWindow.h"
-#include "Document.h"
-#include "Element.h"
-#include "JSCustomElementInterface.h"
-#include "JSDOMBinding.h"
-#include <heap/Heap.h>
-#include <wtf/Optional.h>
-#include <wtf/Ref.h>
-
-namespace WebCore {
-
-class LifecycleQueueItem {
-public:
-    enum class Type {
-        ElementUpgrade,
-        Connected,
-        Disconnected,
-        AttributeChanged,
-    };
-
-    LifecycleQueueItem(Type type, Element& element, JSCustomElementInterface& elementInterface)
-        : m_type(type)
-        , m_element(element)
-        , m_interface(elementInterface)
-    { }
-
-    LifecycleQueueItem(Element& element, JSCustomElementInterface& elementInterface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
-        : m_type(Type::AttributeChanged)
-        , m_element(element)
-        , m_interface(elementInterface)
-        , m_attributeName(attributeName)
-        , m_oldValue(oldValue)
-        , m_newValue(newValue)
-    { }
-
-    void invoke()
-    {
-        switch (m_type) {
-        case Type::ElementUpgrade:
-            m_interface->upgradeElement(m_element.get());
-            break;
-        case Type::Connected:
-            m_interface->invokeConnectedCallback(m_element.get());
-            break;
-        case Type::Disconnected:
-            m_interface->invokeDisconnectedCallback(m_element.get());
-            break;
-        case Type::AttributeChanged:
-            ASSERT(m_attributeName);
-            m_interface->invokeAttributeChangedCallback(m_element.get(), m_attributeName.value(), m_oldValue, m_newValue);
-            break;
-        }
-    }
-
-private:
-    Type m_type;
-    Ref<Element> m_element;
-    Ref<JSCustomElementInterface> m_interface;
-    Optional<QualifiedName> m_attributeName;
-    AtomicString m_oldValue;
-    AtomicString m_newValue;
-};
-
-LifecycleCallbackQueue::LifecycleCallbackQueue()
-{ }
-
-LifecycleCallbackQueue::~LifecycleCallbackQueue()
-{
-    ASSERT(m_items.isEmpty());
-}
-
-void LifecycleCallbackQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& elementInterface)
-{
-    if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
-        queue->m_items.append(LifecycleQueueItem(LifecycleQueueItem::Type::ElementUpgrade, element, elementInterface));
-}
-
-static JSCustomElementInterface* findInterfaceForCustomElement(Element& element)
-{
-    ASSERT(element.isCustomElement());
-    auto* window = element.document().domWindow();
-    if (!window)
-        return nullptr;
-
-    auto* registry = window->customElementsRegistry();
-    if (!registry)
-        return nullptr;
-
-    return registry->findInterface(element.tagQName());
-}
-
-void LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded(Element& element)
-{
-    auto* elementInterface = findInterfaceForCustomElement(element);
-    if (!elementInterface)
-        return;
-
-    if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
-        queue->m_items.append({LifecycleQueueItem::Type::Connected, element, *elementInterface});
-}
-
-void LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded(Element& element)
-{
-    auto* elementInterface = findInterfaceForCustomElement(element);
-    if (!elementInterface)
-        return;
-
-    if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
-        queue->m_items.append({LifecycleQueueItem::Type::Disconnected, element, *elementInterface});
-}
-
-void LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded(Element& element, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
-{
-    auto* elementInterface = findInterfaceForCustomElement(element);
-    if (!elementInterface || !elementInterface->observesAttribute(attributeName.localName()))
-        return;
-
-    if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
-        queue->m_items.append({element, *elementInterface, attributeName, oldValue, newValue});
-}
-
-void LifecycleCallbackQueue::invokeAll()
-{
-    Vector<LifecycleQueueItem> items;
-    items.swap(m_items);
-    for (auto& item : items)
-        item.invoke();
-}
-
-LifecycleCallbackQueue* CustomElementLifecycleProcessingStack::ensureCurrentQueue()
-{
-    // FIXME: This early exit indicates a bug that some DOM API is missing CEReactions
-    if (!s_currentProcessingStack)
-        return nullptr;
-
-    auto*& queue = s_currentProcessingStack->m_queue;
-    if (!queue) // We use a raw pointer to avoid genearing code to delete it in ~CustomElementLifecycleProcessingStack.
-        queue = new LifecycleCallbackQueue;
-    return queue;
-}
-
-CustomElementLifecycleProcessingStack* CustomElementLifecycleProcessingStack::s_currentProcessingStack = nullptr;
-
-void CustomElementLifecycleProcessingStack::processQueue()
-{
-    ASSERT(m_queue);
-    m_queue->invokeAll();
-    delete m_queue;
-    m_queue = nullptr;
-}
-
-}
-
-#endif

Deleted: trunk/Source/WebCore/dom/LifecycleCallbackQueue.h (204651 => 204652)


--- trunk/Source/WebCore/dom/LifecycleCallbackQueue.h	2016-08-19 20:40:16 UTC (rev 204651)
+++ trunk/Source/WebCore/dom/LifecycleCallbackQueue.h	2016-08-19 21:02:31 UTC (rev 204652)
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(CUSTOM_ELEMENTS)
-
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class JSCustomElementInterface;
-class Document;
-class Element;
-class LifecycleQueueItem;
-class QualifiedName;
-
-class LifecycleCallbackQueue {
-    WTF_MAKE_NONCOPYABLE(LifecycleCallbackQueue);
-public:
-    LifecycleCallbackQueue();
-    ~LifecycleCallbackQueue();
-
-    static void enqueueElementUpgrade(Element&, JSCustomElementInterface&);
-    static void enqueueConnectedCallbackIfNeeded(Element&);
-    static void enqueueDisconnectedCallbackIfNeeded(Element&);
-    static void enqueueAttributeChangedCallbackIfNeeded(Element&, const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue);
-
-    void invokeAll();
-
-private:
-    Vector<LifecycleQueueItem> m_items;
-};
-
-class CustomElementLifecycleProcessingStack {
-public:
-    CustomElementLifecycleProcessingStack()
-        : m_previousProcessingStack(s_currentProcessingStack)
-    {
-        s_currentProcessingStack = this;
-    }
-
-    ~CustomElementLifecycleProcessingStack()
-    {
-        if (UNLIKELY(m_queue))
-            processQueue();
-        s_currentProcessingStack = m_previousProcessingStack;
-    }
-
-    // FIXME: This should be a reference once "ensure" starts to work.
-    static LifecycleCallbackQueue* ensureCurrentQueue();
-
-    static bool hasCurrentProcessingStack() { return s_currentProcessingStack; }
-
-private:
-    void processQueue();
-
-    LifecycleCallbackQueue* m_queue { nullptr };
-    CustomElementLifecycleProcessingStack* m_previousProcessingStack;
-
-    static CustomElementLifecycleProcessingStack* s_currentProcessingStack;
-};
-
-}
-
-#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to