1 {% from 'macros.tmpl' import license %}
5 #include "core/css/CSSPropertyMetadata.h"
7 #include "platform/RuntimeEnabledFeatures.h"
8 #include "wtf/BitArray.h"
11 {% for flag, function_name in switches %}
13 bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID property)
16 case CSSPropertyInvalid:
19 {% for property_id, property in properties.items() if property[flag] %}
29 bool CSSPropertyMetadata::isEnabledProperty(CSSPropertyID property)
31 static BitArray<numCSSProperties>* enabledProperties = 0;
32 if (!enabledProperties) {
33 enabledProperties = new BitArray<numCSSProperties>(true); // All bits sets to 1.
34 {% for property_id, property in properties.items() if property.runtime_flag %}
35 if (!RuntimeEnabledFeatures::{{property.runtime_flag|lower_first}}Enabled())
36 enabledProperties->clear({{property_id}} - {{first_enum_value}});
38 {% for property_id, property in properties.items() if property.is_internal %}
39 enabledProperties->clear({{property_id}} - {{first_enum_value}});
42 return enabledProperties->get(property - {{first_enum_value}});
45 void CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector(const CSSPropertyID* properties, size_t propertyCount, Vector<CSSPropertyID>& outVector)
47 for (unsigned i = 0; i < propertyCount; i++) {
48 CSSPropertyID property = properties[i];
49 if (isEnabledProperty(property))
50 outVector.append(property);