{% from 'templates/macros.tmpl' import license, source_files_for_generated_file %}
{{license()}}
{{source_files_for_generated_file(template_file, input_files)}}
{% if suffix == 'Modules' %}
#include "third_party/blink/renderer/modules/event_modules_factory.h"
{% else %}
#include "third_party/blink/renderer/core/events/event_factory.h"
{% endif %}
{% for header_path in include_header_paths %}
#include "{{header_path}}"
{% endfor %}
namespace blink {
Event* Event{{suffix}}Factory::Create(ScriptState* script_state, ExecutionContext* executionContext, const String& type) {
{% for event in events %}
if (EqualIgnoringASCIICase(type, "{{event|name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled}}Enabled(executionContext){% endif %}) {
{% if not event|name|create_event_ignore_case_list %}
UseCounter::Count(executionContext, WebFeature::k{{event|name|measure_name}});
{% endif %}
{% if event|name|needs_script_state %}
return {{event|cpp_name}}::Create(script_state);
{% else %}
return {{event|cpp_name}}::Create();
{% endif %}
}
{% endfor %}
return nullptr;
}
} // namespace blink