Index: Source/core/dom/EventFactory.cpp.tmpl |
diff --git a/Source/core/dom/EventFactory.cpp.tmpl b/Source/core/dom/EventFactory.cpp.tmpl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dfbe9e4cab684c08191b5b944aaa3a9c6f1da731 |
--- /dev/null |
+++ b/Source/core/dom/EventFactory.cpp.tmpl |
@@ -0,0 +1,26 @@ |
+{% from "macros.tmpl" import wrap_with_condition -%} |
+ |
+{{ license }} |
+#include "config.h" |
+#include "EventFactory.h" |
+ |
+#include "EventHeaders.h" |
+#include "RuntimeEnabledFeatures.h" |
+ |
+namespace WebCore { |
+ |
+PassRefPtr<{{namespace}}> {{namespace}}Factory::create(const String& type) |
+{ |
+{%- for event in events %} |
+{%- call wrap_with_condition(event.conditional) %} |
+ if (type == "{{event.name}}" |
+ {{- " && RuntimeEnabledFeatures::" + event.runtimeConditional + "()" if event.runtimeConditional else "" -}} |
+ ) |
+ return {{event.interfaceName}}::create(); |
+{%- endcall %} |
+{%- endfor %} |
+ return 0; |
+} |
+ |
+} // namespace WebCore |
+ |