Changeset 204652 in webkit


Ignore:
Timestamp:
Aug 19, 2016 2:02:31 PM (8 years ago)
Author:
rniwa@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
10 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r204641 r204652  
    14391439    dom/ContainerNodeAlgorithms.cpp
    14401440    dom/ContextDestructionObserver.cpp
     1441    dom/CustomElementReactionQueue.cpp
    14411442    dom/CustomElementsRegistry.cpp
    14421443    dom/CustomEvent.cpp
     
    14851486    dom/InlineStyleSheetOwner.cpp
    14861487    dom/KeyboardEvent.cpp
    1487     dom/LifecycleCallbackQueue.cpp
    14881488    dom/LiveNodeList.cpp
    14891489    dom/MessageChannel.cpp
  • trunk/Source/WebCore/ChangeLog

    r204648 r204652  
     12016-08-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Rename LifecycleCallback to CustomElementReaction
     4        https://bugs.webkit.org/show_bug.cgi?id=160991
     5
     6        Reviewed by Chris Dumez.
     7
     8        Renamed LifecycleCallbackQueue and CustomElementLifecycleProcessingStack
     9        to CustomElementReactionQueue and CustomElementReactionStack per the latest spec:
     10        https://html.spec.whatwg.org/#custom-element-reactions
     11
     12        No new tests since this is just a rename of classes which are not exposed to the Web.
     13
     14        * CMakeLists.txt:
     15        * WebCore.xcodeproj/project.pbxproj:
     16
     17        * bindings/js/JSCustomElementsRegistryCustom.cpp:
     18        (WebCore::getCallback): Renamed from getLifecycleCallback.
     19        (WebCore::JSCustomElementsRegistry::define):
     20        (WebCore::getLifecycleCallback): Deleted.
     21
     22        * bindings/js/JSMainThreadExecState.h:
     23        (WebCore::JSMainThreadNullState):
     24
     25        * bindings/scripts/CodeGeneratorJS.pm:
     26        (GenerateImplementation):
     27
     28        * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
     29        * bindings/scripts/test/TestObj.idl:
     30
     31        * dom/CustomElementReactionQueue.cpp: Moved from Source/WebCore/dom/LifecycleCallbackQueue.cpp.
     32        (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
     33        (WebCore::CustomElementReactionQueue::CustomElementReactionQueue):
     34        (WebCore::CustomElementReactionQueue::~CustomElementReactionQueue):
     35        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
     36        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
     37        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
     38        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
     39        (WebCore::CustomElementReactionQueue::invokeAll):
     40        (WebCore::CustomElementReactionStack::ensureCurrentQueue):
     41        (WebCore::CustomElementReactionStack::processQueue):
     42
     43        * dom/CustomElementReactionQueue.h: Moved from Source/WebCore/dom/LifecycleCallbackQueue.h.
     44        (WebCore::CustomElementReactionStack::CustomElementReactionStack):
     45        (WebCore::CustomElementReactionStack::~CustomElementReactionStack):
     46        (WebCore::CustomElementReactionStack::hasCurrentProcessingStack):
     47
     48        * dom/Document.cpp:
     49        (WebCore::createFallbackHTMLElement):
     50
     51        * dom/Element.cpp:
     52        (WebCore::Element::attributeChanged):
     53        (WebCore::Element::insertedInto):
     54        (WebCore::Element::removedFrom):
     55
    1562016-08-19  Chris Dumez  <cdumez@apple.com>
    257
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r204641 r204652  
    39313931                9B532EA41BA928570038A827 /* SlotAssignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B532EA21BA928570038A827 /* SlotAssignment.h */; };
    39323932                9B55EEE91B3E8898005342BC /* EditorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */; };
    3933                 9B56C9AA1C89329A00C456DF /* LifecycleCallbackQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */; };
     3933                9B56C9AA1C89329A00C456DF /* CustomElementReactionQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */; };
    39343934                9B69D3B41B98FFE900E3512B /* HTMLSlotElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B69D3B21B98FFE900E3512B /* HTMLSlotElement.cpp */; };
    39353935                9B69D3B51B98FFE900E3512B /* HTMLSlotElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B69D3B31B98FFE900E3512B /* HTMLSlotElement.h */; };
     
    1151611516                9B532EA21BA928570038A827 /* SlotAssignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotAssignment.h; sourceTree = "<group>"; };
    1151711517                9B55EEE81B3E8898005342BC /* EditorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorCocoa.mm; sourceTree = "<group>"; };
    11518                 9B56C9A81C89312800C456DF /* LifecycleCallbackQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LifecycleCallbackQueue.h; sourceTree = "<group>"; };
    11519                 9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LifecycleCallbackQueue.cpp; sourceTree = "<group>"; };
     11518                9B56C9A81C89312800C456DF /* CustomElementReactionQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomElementReactionQueue.h; sourceTree = "<group>"; };
     11519                9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomElementReactionQueue.cpp; sourceTree = "<group>"; };
    1152011520                9B69D3B11B98FF0A00E3512B /* HTMLSlotElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLSlotElement.idl; sourceTree = "<group>"; };
    1152111521                9B69D3B21B98FFE900E3512B /* HTMLSlotElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLSlotElement.cpp; sourceTree = "<group>"; };
     
    2399923999                                9BD4E9191C462CFC005065BC /* CustomElementsRegistry.h */,
    2400024000                                9BC5F9DE1D5AAD5D002B749D /* CustomElementsRegistry.idl */,
     24001                                9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */,
     24002                                9B56C9A81C89312800C456DF /* CustomElementReactionQueue.h */,
    2400124003                                62CD32561157E57C0063B0A7 /* CustomEvent.cpp */,
    2400224004                                62CD32571157E57C0063B0A7 /* CustomEvent.h */,
     
    2413824140                                85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */,
    2413924141                                14CF7C2009F7110600EB3665 /* KeyboardEvent.idl */,
    24140                                 9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */,
    24141                                 9B56C9A81C89312800C456DF /* LifecycleCallbackQueue.h */,
    2414224142                                BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */,
    2414324143                                BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */,
     
    3057730577                                0F87166F1C869D83004FF0DE /* LengthPoint.cpp in Sources */,
    3057830578                                0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */,
    30579                                 9B56C9AA1C89329A00C456DF /* LifecycleCallbackQueue.cpp in Sources */,
     30579                                9B56C9AA1C89329A00C456DF /* CustomElementReactionQueue.cpp in Sources */,
    3058030580                                FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
    3058130581                                89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSCustomElementsRegistryCustom.cpp

    r204611 r204652  
    4040#if ENABLE(CUSTOM_ELEMENTS)
    4141
    42 static JSObject* getLifecycleCallback(ExecState& state, JSObject& prototype, const Identifier& id)
     42static JSObject* getCustomElementCallback(ExecState& state, JSObject& prototype, const Identifier& id)
    4343{
    4444    JSValue callback = prototype.get(&state, id);
     
    4848        return nullptr;
    4949    if (!callback.isFunction()) {
    50         throwTypeError(&state, ASCIILiteral("A lifecycle callback must be a function"));
     50        throwTypeError(&state, ASCIILiteral("A custom element callback must be a function"));
    5151        return nullptr;
    5252    }
     
    108108    auto elementInterface = JSCustomElementInterface::create(name, constructor, globalObject());
    109109
    110     auto* connectedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "connectedCallback"));
     110    auto* connectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "connectedCallback"));
    111111    if (state.hadException())
    112112        return jsUndefined();
     
    114114        elementInterface->setConnectedCallback(connectedCallback);
    115115
    116     auto* disconnectedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "disconnectedCallback"));
     116    auto* disconnectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "disconnectedCallback"));
    117117    if (state.hadException())
    118118        return jsUndefined();
     
    121121
    122122    // FIXME: Add the support for adoptedCallback.
    123     getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "adoptedCallback"));
     123    getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "adoptedCallback"));
    124124    if (state.hadException())
    125125        return jsUndefined();
    126126
    127     auto* attributeChangedCallback = getLifecycleCallback(state, prototypeObject, Identifier::fromString(&vm, "attributeChangedCallback"));
     127    auto* attributeChangedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "attributeChangedCallback"));
    128128    if (state.hadException())
    129129        return jsUndefined();
  • trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h

    r197611 r204652  
    2727#define JSMainThreadExecState_h
    2828
     29#include "CustomElementReactionQueue.h"
    2930#include "JSDOMBinding.h"
    30 #include "LifecycleCallbackQueue.h"
    3131#include <runtime/Completion.h>
    3232#include <runtime/Microtask.h>
     
    149149    JSC::ExecState* m_previousState;
    150150#if ENABLE(CUSTOM_ELEMENTS)
    151     CustomElementLifecycleProcessingStack m_lifecycleProcessingStack;
     151    CustomElementReactionStack m_customElementReactionStack;
    152152#endif
    153153};
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r204611 r204652  
    33433343            if ($function->signature->extendedAttributes->{"CEReactions"}) {
    33443344                push(@implContent, "#if ENABLE(CUSTOM_ELEMENTS)\n");
    3345                 push(@implContent, "    CustomElementLifecycleProcessingStack customElementLifecycleProcessingStack;\n");
     3345                push(@implContent, "    CustomElementReactionStack customElementReactionStack;\n");
    33463346                push(@implContent, "#endif\n");
    3347                 $implIncludes{"LifecycleCallbackQueue.h"} = 1;
     3347                $implIncludes{"CustomElementReactionQueue.h"} = 1;
    33483348            }
    33493349
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r204589 r204652  
    2323
    2424#include "CallbackFunction.h"
     25#include "CustomElementReactionQueue.h"
    2526#include "DOMStringList.h"
    2627#include "Dictionary.h"
     
    5051#include "JSTestSubObj.h"
    5152#include "JSXPathNSResolver.h"
    52 #include "LifecycleCallbackQueue.h"
    5353#include "RuntimeEnabledFeatures.h"
    5454#include "SVGDocument.h"
     
    725725JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunction(JSC::ExecState*);
    726726JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException(JSC::ExecState*);
    727 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack(JSC::ExecState*);
     727JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(JSC::ExecState*);
    728728JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot(JSC::ExecState*);
    729729
     
    13121312    { "testPromiseFunctionWithOptionalIntArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
    13131313    { "testPromiseOverloadedFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseOverloadedFunction), (intptr_t) (1) } },
    1314     { "methodWithNeedsLifecycleProcessingStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack), (intptr_t) (0) } },
     1314    { "methodWithNeedsCustomElementReactionStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack), (intptr_t) (0) } },
    13151315    { "attachShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAttachShadowRoot), (intptr_t) (1) } },
    13161316#if ENABLE(Condition1)
     
    63776377}
    63786378
    6379 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack(ExecState* state)
     6379EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(ExecState* state)
    63806380{
    63816381#if ENABLE(CUSTOM_ELEMENTS)
    6382     CustomElementLifecycleProcessingStack customElementLifecycleProcessingStack;
    6383 #endif
    6384     JSValue thisValue = state->thisValue();
    6385     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
    6386     if (UNLIKELY(!castedThis))
    6387         return throwThisTypeError(*state, "TestObject", "methodWithNeedsLifecycleProcessingStack");
    6388     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    6389     auto& impl = castedThis->wrapped();
    6390     impl.methodWithNeedsLifecycleProcessingStack();
     6382    CustomElementReactionStack customElementReactionStack;
     6383#endif
     6384    JSValue thisValue = state->thisValue();
     6385    auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     6386    if (UNLIKELY(!castedThis))
     6387        return throwThisTypeError(*state, "TestObject", "methodWithNeedsCustomElementReactionStack");
     6388    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     6389    auto& impl = castedThis->wrapped();
     6390    impl.methodWithNeedsCustomElementReactionStack();
    63916391    return JSValue::encode(jsUndefined());
    63926392}
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r204615 r204652  
    391391
    392392#if defined(TESTING_JS)
    393     [CEReactions] void methodWithNeedsLifecycleProcessingStack();
     393    [CEReactions] void methodWithNeedsCustomElementReactionStack();
    394394#endif
    395395
  • trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp

    r204651 r204652  
    2525
    2626#include "config.h"
    27 #include "LifecycleCallbackQueue.h"
     27#include "CustomElementReactionQueue.h"
    2828
    2929#if ENABLE(CUSTOM_ELEMENTS)
     
    4141namespace WebCore {
    4242
    43 class LifecycleQueueItem {
     43class CustomElementReactionQueueItem {
    4444public:
    4545    enum class Type {
     
    5050    };
    5151
    52     LifecycleQueueItem(Type type, Element& element, JSCustomElementInterface& elementInterface)
     52    CustomElementReactionQueueItem(Type type, Element& element, JSCustomElementInterface& elementInterface)
    5353        : m_type(type)
    5454        , m_element(element)
     
    5656    { }
    5757
    58     LifecycleQueueItem(Element& element, JSCustomElementInterface& elementInterface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
     58    CustomElementReactionQueueItem(Element& element, JSCustomElementInterface& elementInterface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
    5959        : m_type(Type::AttributeChanged)
    6060        , m_element(element)
     
    9393};
    9494
    95 LifecycleCallbackQueue::LifecycleCallbackQueue()
     95CustomElementReactionQueue::CustomElementReactionQueue()
    9696{ }
    9797
    98 LifecycleCallbackQueue::~LifecycleCallbackQueue()
     98CustomElementReactionQueue::~CustomElementReactionQueue()
    9999{
    100100    ASSERT(m_items.isEmpty());
    101101}
    102102
    103 void LifecycleCallbackQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& elementInterface)
     103void CustomElementReactionQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& elementInterface)
    104104{
    105     if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
    106         queue->m_items.append(LifecycleQueueItem(LifecycleQueueItem::Type::ElementUpgrade, element, elementInterface));
     105    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
     106        queue->m_items.append({CustomElementReactionQueueItem::Type::ElementUpgrade, element, elementInterface});
    107107}
    108108
     
    121121}
    122122
    123 void LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded(Element& element)
     123void CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded(Element& element)
    124124{
    125125    auto* elementInterface = findInterfaceForCustomElement(element);
     
    127127        return;
    128128
    129     if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
    130         queue->m_items.append({LifecycleQueueItem::Type::Connected, element, *elementInterface});
     129    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
     130        queue->m_items.append({CustomElementReactionQueueItem::Type::Connected, element, *elementInterface});
    131131}
    132132
    133 void LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded(Element& element)
     133void CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded(Element& element)
    134134{
    135135    auto* elementInterface = findInterfaceForCustomElement(element);
     
    137137        return;
    138138
    139     if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
    140         queue->m_items.append({LifecycleQueueItem::Type::Disconnected, element, *elementInterface});
     139    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
     140        queue->m_items.append({CustomElementReactionQueueItem::Type::Disconnected, element, *elementInterface});
    141141}
    142142
    143 void LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded(Element& element, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
     143void CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded(Element& element, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)
    144144{
    145145    auto* elementInterface = findInterfaceForCustomElement(element);
     
    147147        return;
    148148
    149     if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue())
     149    if (auto* queue = CustomElementReactionStack::ensureCurrentQueue())
    150150        queue->m_items.append({element, *elementInterface, attributeName, oldValue, newValue});
    151151}
    152152
    153 void LifecycleCallbackQueue::invokeAll()
     153void CustomElementReactionQueue::invokeAll()
    154154{
    155     Vector<LifecycleQueueItem> items;
     155    Vector<CustomElementReactionQueueItem> items;
    156156    items.swap(m_items);
    157157    for (auto& item : items)
     
    159159}
    160160
    161 LifecycleCallbackQueue* CustomElementLifecycleProcessingStack::ensureCurrentQueue()
     161CustomElementReactionQueue* CustomElementReactionStack::ensureCurrentQueue()
    162162{
    163163    // FIXME: This early exit indicates a bug that some DOM API is missing CEReactions
     
    166166
    167167    auto*& queue = s_currentProcessingStack->m_queue;
    168     if (!queue) // We use a raw pointer to avoid genearing code to delete it in ~CustomElementLifecycleProcessingStack.
    169         queue = new LifecycleCallbackQueue;
     168    if (!queue) // We use a raw pointer to avoid genearing code to delete it in ~CustomElementReactionStack.
     169        queue = new CustomElementReactionQueue;
    170170    return queue;
    171171}
    172172
    173 CustomElementLifecycleProcessingStack* CustomElementLifecycleProcessingStack::s_currentProcessingStack = nullptr;
     173CustomElementReactionStack* CustomElementReactionStack::s_currentProcessingStack = nullptr;
    174174
    175 void CustomElementLifecycleProcessingStack::processQueue()
     175void CustomElementReactionStack::processQueue()
    176176{
    177177    ASSERT(m_queue);
  • trunk/Source/WebCore/dom/CustomElementReactionQueue.h

    r204651 r204652  
    3737class Document;
    3838class Element;
    39 class LifecycleQueueItem;
     39class CustomElementReactionQueueItem;
    4040class QualifiedName;
    4141
    42 class LifecycleCallbackQueue {
    43     WTF_MAKE_NONCOPYABLE(LifecycleCallbackQueue);
     42class CustomElementReactionQueue {
     43    WTF_MAKE_NONCOPYABLE(CustomElementReactionQueue);
    4444public:
    45     LifecycleCallbackQueue();
    46     ~LifecycleCallbackQueue();
     45    CustomElementReactionQueue();
     46    ~CustomElementReactionQueue();
    4747
    4848    static void enqueueElementUpgrade(Element&, JSCustomElementInterface&);
     
    5454
    5555private:
    56     Vector<LifecycleQueueItem> m_items;
     56    Vector<CustomElementReactionQueueItem> m_items;
    5757};
    5858
    59 class CustomElementLifecycleProcessingStack {
     59class CustomElementReactionStack {
    6060public:
    61     CustomElementLifecycleProcessingStack()
     61    CustomElementReactionStack()
    6262        : m_previousProcessingStack(s_currentProcessingStack)
    6363    {
     
    6565    }
    6666
    67     ~CustomElementLifecycleProcessingStack()
     67    ~CustomElementReactionStack()
    6868    {
    6969        if (UNLIKELY(m_queue))
     
    7373
    7474    // FIXME: This should be a reference once "ensure" starts to work.
    75     static LifecycleCallbackQueue* ensureCurrentQueue();
     75    static CustomElementReactionQueue* ensureCurrentQueue();
    7676
    7777    static bool hasCurrentProcessingStack() { return s_currentProcessingStack; }
     
    8080    void processQueue();
    8181
    82     LifecycleCallbackQueue* m_queue { nullptr };
    83     CustomElementLifecycleProcessingStack* m_previousProcessingStack;
     82    CustomElementReactionQueue* m_queue { nullptr };
     83    CustomElementReactionStack* m_previousProcessingStack;
    8484
    85     static CustomElementLifecycleProcessingStack* s_currentProcessingStack;
     85    static CustomElementReactionStack* s_currentProcessingStack;
    8686};
    8787
  • trunk/Source/WebCore/dom/Document.cpp

    r204637 r204652  
    4545#include "ContentSecurityPolicy.h"
    4646#include "CookieJar.h"
     47#include "CustomElementReactionQueue.h"
    4748#include "CustomElementsRegistry.h"
    4849#include "CustomEvent.h"
     
    106107#include "KeyboardEvent.h"
    107108#include "Language.h"
    108 #include "LifecycleCallbackQueue.h"
    109109#include "LoaderStrategy.h"
    110110#include "Logging.h"
     
    10941094                auto element = HTMLElement::create(name, document);
    10951095                element->setIsUnresolvedCustomElement();
    1096                 LifecycleCallbackQueue::enqueueElementUpgrade(element.get(), *elementInterface);
     1096                CustomElementReactionQueue::enqueueElementUpgrade(element.get(), *elementInterface);
    10971097                return element;
    10981098            }
  • trunk/Source/WebCore/dom/Element.cpp

    r204611 r204652  
    3838#include "ComposedTreeAncestorIterator.h"
    3939#include "ContainerNodeAlgorithms.h"
     40#include "CustomElementReactionQueue.h"
    4041#include "CustomElementsRegistry.h"
    4142#include "DOMTokenList.h"
     
    7071#include "KeyboardEvent.h"
    7172#include "KeyframeEffect.h"
    72 #include "LifecycleCallbackQueue.h"
    7373#include "MainFrame.h"
    7474#include "MutationObserverInterestGroup.h"
     
    12941294#if ENABLE(CUSTOM_ELEMENTS)
    12951295    if (UNLIKELY(isCustomElement()))
    1296         LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded(*this, name, oldValue, newValue);
     1296        CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded(*this, name, oldValue, newValue);
    12971297#endif
    12981298
     
    15991599#if ENABLE(CUSTOM_ELEMENTS)
    16001600    if (newDocument && UNLIKELY(isCustomElement()))
    1601         LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded(*this);
     1601        CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded(*this);
    16021602#endif
    16031603
     
    16501650#if ENABLE(CUSTOM_ELEMENTS)
    16511651        if (oldDocument && UNLIKELY(isCustomElement()))
    1652             LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded(*this);
     1652            CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded(*this);
    16531653#endif
    16541654    }
Note: See TracChangeset for help on using the changeset viewer.