1{% from 'macros.tmpl' import license %} 2{{license()}} 3 4#include "config.h" 5{% if suffix == 'Modules' %} 6#include "modules/{{namespace}}{{suffix}}Factory.h" 7{% else %} 8#include "core/events/{{namespace}}Factory.h" 9{% endif %} 10 11#include "{{namespace}}{{suffix}}Headers.h" 12#include "platform/RuntimeEnabledFeatures.h" 13 14namespace WebCore { 15 16PassRefPtrWillBeRawPtr<{{namespace}}> {{namespace}}{{suffix}}Factory::create(const String& type) 17{ 18 {% for event in events %} 19 {% filter enable_conditional(event.Conditional) %} 20 {% if event|script_name|case_insensitive_matching %} 21 if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) 22 {% else %} 23 if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) 24 {% endif %} 25 return {{event|cpp_name}}::create(); 26 {% endfilter %} 27 {% endfor %} 28 return nullptr; 29} 30 31} // namespace WebCore 32