| OLD | NEW |
| 1 {% from "macros.tmpl" import license %} | 1 {% from "macros.tmpl" import license %} |
| 2 {{ license() }} | 2 {{ license() }} |
| 3 | 3 |
| 4 #include "{{namespace}}Names.h" | 4 #include "{{namespace}}Names.h" |
| 5 | 5 |
| 6 #include "wtf/StaticConstructors.h" | 6 #include "wtf/StaticConstructors.h" |
| 7 #include "wtf/StdLibExtras.h" | 7 #include "wtf/StdLibExtras.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 namespace {{namespace}}Names { | 10 namespace {{namespace}}Names { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 struct NameEntry { | 55 struct NameEntry { |
| 56 const char* name; | 56 const char* name; |
| 57 unsigned hash; | 57 unsigned hash; |
| 58 unsigned char length; | 58 unsigned char length; |
| 59 unsigned char isTag; | 59 unsigned char isTag; |
| 60 unsigned char isAttr; | 60 unsigned char isAttr; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 // Use placement new to initialize the globals. | 63 // Use placement new to initialize the globals. |
| 64 AtomicString {{namespace_prefix}}NS("{{namespace_uri}}", AtomicString::Const
ructFromLiteral); | 64 AtomicString {{namespace_prefix}}NS("{{namespace_uri}}"); |
| 65 | 65 |
| 66 // Namespace | 66 // Namespace |
| 67 new ((void*)&{{namespace_prefix}}NamespaceURI) AtomicString({{namespace_pref
ix}}NS); | 67 new ((void*)&{{namespace_prefix}}NamespaceURI) AtomicString({{namespace_pref
ix}}NS); |
| 68 {% set tagnames = tags|map(attribute='name')|list() %} | 68 {% set tagnames = tags|map(attribute='name')|list() %} |
| 69 {% set attrnames = attrs|map(attribute='name')|list() %} | 69 {% set attrnames = attrs|map(attribute='name')|list() %} |
| 70 static const NameEntry kNames[] = { | 70 static const NameEntry kNames[] = { |
| 71 {% for name, tag_list in (tags + attrs)|groupby('name')|sort(attribute=0, ca
se_sensitive=True) %} | 71 {% for name, tag_list in (tags + attrs)|groupby('name')|sort(attribute=0, ca
se_sensitive=True) %} |
| 72 { "{{name}}", {{name|hash}}, {{name|length}}, {{ (name in tagnames)|int
}}, {{ (name in attrnames)|int }} }, | 72 { "{{name}}", {{name|hash}}, {{name|length}}, {{ (name in tagnames)|int
}}, {{ (name in attrnames)|int }} }, |
| 73 {% endfor %} | 73 {% endfor %} |
| 74 }; | 74 }; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 98 attr_i++; | 98 attr_i++; |
| 99 } | 99 } |
| 100 {% if tags %} | 100 {% if tags %} |
| 101 ASSERT(tag_i == {{namespace}}TagsCount); | 101 ASSERT(tag_i == {{namespace}}TagsCount); |
| 102 {% endif %} | 102 {% endif %} |
| 103 ASSERT(attr_i == {{namespace}}AttrsCount); | 103 ASSERT(attr_i == {{namespace}}AttrsCount); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // {{namespace}} | 106 } // {{namespace}} |
| 107 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |