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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp

Issue 2066813003: Revert of Implement script-side of callback reactions for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@callback-ce
Patch Set: Created 4 years, 6 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/ScriptCustomElementDefinitionBuilder.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
index 616d518cfbd18ee83d4dfc2d7814e168efd3d805..158a6dfe6008f250db694e66517f97cd2e86a60c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
@@ -113,7 +113,7 @@
}
bool ScriptCustomElementDefinitionBuilder::callableForName(const String& name,
- v8::Local<v8::Function>& callback) const
+ v8::Local<v8::Object>& callback) const
{
v8::Local<v8::Value> value;
if (!valueForName(m_prototype, name, value))
@@ -121,12 +121,17 @@
// "undefined" means "omitted", so return true.
if (value->IsUndefined())
return true;
- if (!value->IsFunction()) {
+ if (!value->IsObject()) {
m_exceptionState.throwTypeError(
- String::format("\"%s\" is not a callable object", name.ascii().data()));
+ String::format("\"%s\" is not an object", name.ascii().data()));
return false;
}
- callback = value.As<v8::Function>();
+ callback = value.As<v8::Object>();
+ if (!callback->IsCallable()) {
+ m_exceptionState.throwTypeError(
+ String::format("\"%s\" is not callable", name.ascii().data()));
+ return false;
+ }
return true;
}
@@ -157,10 +162,10 @@
const String kConnectedCallback = "connectedCallback";
const String kDisconnectedCallback = "disconnectedCallback";
const String kAttributeChangedCallback = "attributeChangedCallback";
- return callableForName(kConnectedCallback, m_connectedCallback)
+ return retrieveObservedAttributes()
+ && callableForName(kConnectedCallback, m_connectedCallback)
&& callableForName(kDisconnectedCallback, m_disconnectedCallback)
- && callableForName(kAttributeChangedCallback, m_attributeChangedCallback)
- && (m_attributeChangedCallback.IsEmpty() || retrieveObservedAttributes());
+ && callableForName(kAttributeChangedCallback, m_attributeChangedCallback);
}
CustomElementDefinition* ScriptCustomElementDefinitionBuilder::build(

Powered by Google App Engine
This is Rietveld 408576698