-{% from "macros.tmpl" import license -%}
+{% from "macros.tmpl" import license %}
{{ license() }}
#include "config.h"
DEFINE_GLOBAL(AtomicString, {{namespace_prefix}}NamespaceURI)
-{%- if tags %}
-
+{% if tags %}
// Tags
-{%- for tag in tags|sort %}
+{% for tag in tags|sort %}
DEFINE_GLOBAL(QualifiedName, {{tag|symbol}}Tag)
-{%- endfor %}
+{% endfor %}
PassOwnPtr<const QualifiedName*[]> get{{namespace}}Tags()
{
OwnPtr<const QualifiedName*[]> tags = adoptArrayPtr(new const QualifiedName*[{{namespace}}TagsCount]);
-{%- for tag in tags|sort %}
+ {% for tag in tags|sort %}
tags[{{loop.index0}}] = reinterpret_cast<const QualifiedName*>(&{{tag|symbol}}Tag);
-{%- endfor %}
+ {% endfor %}
return tags.release();
}
-{%- endif %}
-
+{% endif %}
// Attributes
-{%- for attr in attrs|sort %}
+{% for attr in attrs|sort %}
DEFINE_GLOBAL(QualifiedName, {{attr|symbol}}Attr)
-{%- endfor %}
+{% endfor %}
PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs()
{
OwnPtr<const QualifiedName*[]> attrs = adoptArrayPtr(new const QualifiedName*[{{namespace}}AttrsCount]);
-{%- for attr in attrs|sort %}
+ {% for attr in attrs|sort %}
attrs[{{loop.index0}}] = reinterpret_cast<const WebCore::QualifiedName*>(&{{attr|symbol}}Attr);
-{%- endfor %}
+ {% endfor %}
return attrs.release();
}
// Namespace
new ((void*)&{{namespace_prefix}}NamespaceURI) AtomicString({{namespace_prefix}}NS);
-
-{%- for name, tag_list in (tags + attrs)|groupby('name')|sort %}
+ {% for name, tag_list in (tags + attrs)|groupby('name')|sort %}
StringImpl* {{tag_list[0]|symbol}}Impl = StringImpl::createStatic("{{name}}", {{name|length}}, {{name|hash}});
-{%- endfor %}
+ {% endfor %}
// Tags
-{%- for tag in tags|sort %}
+ {% for tag in tags|sort %}
createQualifiedName((void*)&{{tag|symbol}}Tag, {{tag|symbol}}Impl, {{namespace_prefix}}NS);
-{%- endfor %}
+ {% endfor %}
// Attrs
-{%- for attr in attrs|sort %}
-{%- if use_namespace_for_attrs %}
+ {% for attr in attrs|sort %}
+ {% if use_namespace_for_attrs %}
createQualifiedName((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl, {{namespace_prefix}}NS);
-{%- else %}
+ {% else %}
createQualifiedName((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl);
-{%- endif %}
-{%- endfor %}
+ {% endif %}
+ {% endfor %}
}
} // {{namespace}}