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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.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/bindings/core/v8/ScriptCustomElementDefinition.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp
index 389e73138753f140bd984e14be476c85357406f1..509c71069c548d0b18503b3aeb3fc7cf26605c3c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp
@@ -356,13 +356,19 @@ void ScriptCustomElementDefinition::runDisconnectedCallback(Element* element)
runCallback(m_disconnectedCallback.newLocal(isolate), element);
}
-void ScriptCustomElementDefinition::runAdoptedCallback(Element* element)
+void ScriptCustomElementDefinition::runAdoptedCallback(
+ Element* element, Document* oldOwner, Document *newOwner)
{
if (!m_scriptState->contextIsValid())
return;
ScriptState::Scope scope(m_scriptState.get());
v8::Isolate* isolate = m_scriptState->isolate();
- runCallback(m_adoptedCallback.newLocal(isolate), element);
+ v8::Local<v8::Value> argv[] = {
+ toV8(oldOwner, m_scriptState->context()->Global(), isolate),
+ toV8(newOwner, m_scriptState->context()->Global(), isolate)
+ };
+ runCallback(m_adoptedCallback.newLocal(isolate), element,
+ WTF_ARRAY_LENGTH(argv), argv);
}
void ScriptCustomElementDefinition::runAttributeChangedCallback(
@@ -373,15 +379,14 @@ void ScriptCustomElementDefinition::runAttributeChangedCallback(
return;
ScriptState::Scope scope(m_scriptState.get());
v8::Isolate* isolate = m_scriptState->isolate();
- const int argc = 4;
- v8::Local<v8::Value> argv[argc] = {
+ v8::Local<v8::Value> argv[] = {
v8String(isolate, name.localName()),
v8StringOrNull(isolate, oldValue),
v8StringOrNull(isolate, newValue),
v8String(isolate, name.namespaceURI()),
};
runCallback(m_attributeChangedCallback.newLocal(isolate), element,
- argc, argv);
+ WTF_ARRAY_LENGTH(argv), argv);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698