|
@@ -124,7 +124,7 @@ void EventTarget::set_event_handler_attribute(FlyString const& name, HTML::Event
|
|
|
|
|
|
RefPtr<DOM::EventListener> listener;
|
|
|
if (!value.callback.is_null()) {
|
|
|
- listener = adopt_ref(*new DOM::EventListener(move(value.callback)));
|
|
|
+ listener = adopt_ref(*new DOM::EventListener(move(value.callback), true));
|
|
|
} else {
|
|
|
StringBuilder builder;
|
|
|
builder.appendff("function {}(event) {{\n{}\n}}", name, value.string);
|
|
@@ -136,7 +136,7 @@ void EventTarget::set_event_handler_attribute(FlyString const& name, HTML::Event
|
|
|
}
|
|
|
auto* function = JS::ECMAScriptFunctionObject::create(target->script_execution_context()->realm().global_object(), name, program->body(), program->parameters(), program->function_length(), nullptr, JS::FunctionKind::Regular, false, false);
|
|
|
VERIFY(function);
|
|
|
- listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::FunctionObject*>(function))));
|
|
|
+ listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::FunctionObject*>(function)), true));
|
|
|
}
|
|
|
if (listener) {
|
|
|
for (auto& registered_listener : target->listeners()) {
|