diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-05 18:47:29 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:31 -0500 |
commit | 2cbd6d3699a07f10e709c1408fbc65b503478a75 (patch) | |
tree | 8e98d9f870739955bb4a3ce6de4117e778da6440 | |
parent | 4dda3f6039c4432a3545986ebc698a725c6c057c (diff) | |
download | UXP-2cbd6d3699a07f10e709c1408fbc65b503478a75.tar UXP-2cbd6d3699a07f10e709c1408fbc65b503478a75.tar.gz UXP-2cbd6d3699a07f10e709c1408fbc65b503478a75.tar.lz UXP-2cbd6d3699a07f10e709c1408fbc65b503478a75.tar.xz UXP-2cbd6d3699a07f10e709c1408fbc65b503478a75.zip |
Bug 1407937 - Move mDefinition from CustomElementReacion to CustomElementUpgradeReaction;
Tag UXP Issue #1344
-rw-r--r-- | dom/base/CustomElementRegistry.cpp | 7 | ||||
-rw-r--r-- | dom/base/CustomElementRegistry.h | 19 |
2 files changed, 7 insertions, 19 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 7fd295201..fc6ac2877 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -442,8 +442,7 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType CustomElementReactionsStack* reactionsStack = docGroup->CustomElementReactionsStack(); - reactionsStack->EnqueueCallbackReaction(aCustomElement, definition, - Move(callback)); + reactionsStack->EnqueueCallbackReaction(aCustomElement, Move(callback)); } void @@ -1025,11 +1024,9 @@ CustomElementReactionsStack::EnqueueUpgradeReaction(Element* aElement, void CustomElementReactionsStack::EnqueueCallbackReaction(Element* aElement, - CustomElementDefinition* aDefinition, UniquePtr<CustomElementCallback> aCustomElementCallback) { - Enqueue(aElement, new CustomElementCallbackReaction(aDefinition, - Move(aCustomElementCallback))); + Enqueue(aElement, new CustomElementCallbackReaction(Move(aCustomElementCallback))); } void diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h index e9b2bee56..674c653ab 100644 --- a/dom/base/CustomElementRegistry.h +++ b/dom/base/CustomElementRegistry.h @@ -212,40 +212,32 @@ private: class CustomElementReaction { public: - explicit CustomElementReaction(CustomElementDefinition* aDefinition) - : mDefinition(aDefinition) - { - } - virtual ~CustomElementReaction() = default; virtual void Invoke(Element* aElement, ErrorResult& aRv) = 0; virtual void Traverse(nsCycleCollectionTraversalCallback& aCb) const { } - -protected: - CustomElementDefinition* mDefinition; }; class CustomElementUpgradeReaction final : public CustomElementReaction { public: explicit CustomElementUpgradeReaction(CustomElementDefinition* aDefinition) - : CustomElementReaction(aDefinition) + : mDefinition(aDefinition) { } private: virtual void Invoke(Element* aElement, ErrorResult& aRv) override; + + CustomElementDefinition* mDefinition; }; class CustomElementCallbackReaction final : public CustomElementReaction { public: - CustomElementCallbackReaction(CustomElementDefinition* aDefinition, - UniquePtr<CustomElementCallback> aCustomElementCallback) - : CustomElementReaction(aDefinition) - , mCustomElementCallback(Move(aCustomElementCallback)) + explicit CustomElementCallbackReaction(UniquePtr<CustomElementCallback> aCustomElementCallback) + : mCustomElementCallback(Move(aCustomElementCallback)) { } @@ -289,7 +281,6 @@ public: * https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction */ void EnqueueCallbackReaction(Element* aElement, - CustomElementDefinition* aDefinition, UniquePtr<CustomElementCallback> aCustomElementCallback); // [CEReactions] Before executing the algorithm's steps |