| Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| index bd6281f1f6add2d9a489b6b7b43faaffc3b22132..8e458ec3cb2d4f0ab4eda8691b009390132a361e 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| @@ -137,14 +137,16 @@ if (UNLIKELY(numArgsPassed <= {{argument.index}})) {
|
| }
|
| {% endif %}
|
| {% if argument.is_callback_interface %}
|
| -{# FIXME: remove EventListener special case #}
|
| +{# FIXME: remove EventListener/NodeFilter special case. crbug.com/630986 #}
|
| {% if argument.idl_type == 'EventListener' %}
|
| {% if method.name == 'RemoveEventListener' or method.name == 'RemoveListener' %}
|
| {{argument.name}} = V8EventListenerHelper::GetEventListener(ScriptState::Current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOnly);
|
| {% else %}{# method.name == 'AddEventListener' #}
|
| {{argument.name}} = V8EventListenerHelper::GetEventListener(ScriptState::Current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOrCreate);
|
| {% endif %}{# method.name #}
|
| -{% else %}{# argument.idl_type == 'EventListener' #}
|
| +{% elif argument.idl_type == 'NodeFilter' %}
|
| +{{argument.name}} = V8NodeFilterCondition::CreateOrNull(info[{{argument.index}}], ScriptState::Current(info.GetIsolate()));
|
| +{% else %}{# argument.idl_type == 'EventListener'/'NodeFilter #}
|
| {# Callback functions must be functions:
|
| http://www.w3.org/TR/WebIDL/#es-callback-function #}
|
| {% if argument.is_optional %}
|
| @@ -164,7 +166,7 @@ if (info.Length() <= {{argument.index}} || !{% if argument.is_nullable %}(info[{
|
| }
|
| {{argument.name}} = {% if argument.is_nullable %}info[{{argument.index}}]->IsNull() ? nullptr : {% endif %}V8{{argument.idl_type}}::Create(v8::Local<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::Current(info.GetIsolate()));
|
| {% endif %}{# argument.is_optional #}
|
| -{% endif %}{# argument.idl_type == 'EventListener' #}
|
| +{% endif %}{# argument.idl_type == 'EventListener'/'NodeFilter' #}
|
| {% elif argument.is_callback_function %}
|
| if ({% if argument.is_nullable %}!IsUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!(info[{{argument.index}}]->IsObject() && v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable())) {
|
| {{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}}
|
|
|