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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementAdoptedCallbackReaction.cpp

Issue 2299033005: Pass the old and new owner documents to the adoptedCallback. (Closed)
Patch Set: WTF_ARRAY_LENGTH Created 4 years, 3 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/CustomElementAdoptedCallbackReaction.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementAdoptedCallbackReaction.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementAdoptedCallbackReaction.cpp
index da9dae9b89df5dc4d69079c2eb2fd5e7598092d9..edde9a7b580fabd4b24c7890102425673c3021a3 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementAdoptedCallbackReaction.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementAdoptedCallbackReaction.cpp
@@ -4,20 +4,30 @@
#include "core/dom/custom/CustomElementAdoptedCallbackReaction.h"
+#include "core/dom/Document.h"
#include "core/dom/custom/CustomElementDefinition.h"
namespace blink {
CustomElementAdoptedCallbackReaction::CustomElementAdoptedCallbackReaction(
- CustomElementDefinition* definition)
+ CustomElementDefinition* definition, Document* oldOwner, Document* newOwner)
: CustomElementReaction(definition)
+ , m_oldOwner(oldOwner)
+ , m_newOwner(newOwner)
{
DCHECK(definition->hasAdoptedCallback());
}
+DEFINE_TRACE(CustomElementAdoptedCallbackReaction)
+{
+ CustomElementReaction::trace(visitor);
+ visitor->trace(m_oldOwner);
+ visitor->trace(m_newOwner);
+}
+
void CustomElementAdoptedCallbackReaction::invoke(Element* element)
{
- m_definition->runAdoptedCallback(element);
+ m_definition->runAdoptedCallback(element, m_oldOwner.get(), m_newOwner.get());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698