| Index: third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
|
| index 97f050626163245fc485303f5a825dde40a44877..fae33029ac5bae7d48d57cf308ec758d8e3feea7 100644
|
| --- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
|
| @@ -28,28 +28,28 @@ bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID property)
|
| }
|
| {% endfor %}
|
|
|
| -// There is one more valid property ID than the total count of CSS properties
|
| -// because of custom properties.
|
| -static const int numValidPropertyIDs = numCSSProperties + 1;
|
| -
|
| bool CSSPropertyMetadata::isEnabledProperty(CSSPropertyID unresolvedProperty)
|
| {
|
| CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
|
| - static BitArray<numValidPropertyIDs>* enabledProperties = 0;
|
| + static BitArray<numCSSProperties>* enabledProperties = 0;
|
| if (!enabledProperties) {
|
| - enabledProperties = new BitArray<numValidPropertyIDs>(true); // All bits sets to 1.
|
| - static_assert(CSSPropertyVariable == {{first_enum_value - 1}}, "CSSPropertyVariable should directly precede first_enum_value.");
|
| - if (!RuntimeEnabledFeatures::cssVariablesEnabled())
|
| - enabledProperties->clear(0);
|
| + enabledProperties = new BitArray<numCSSProperties>(true); // All bits sets to 1.
|
| {% for property_id, property in properties.items() if property.runtime_flag %}
|
| if (!RuntimeEnabledFeatures::{{property.runtime_flag|lower_first}}Enabled())
|
| - enabledProperties->clear({{property_id}} - {{first_enum_value - 1}});
|
| + enabledProperties->clear({{property_id}} - {{first_enum_value}});
|
| {% endfor %}
|
| {% for property_id, property in properties.items() if property.is_internal %}
|
| - enabledProperties->clear({{property_id}} - {{first_enum_value - 1}});
|
| + enabledProperties->clear({{property_id}} - {{first_enum_value}});
|
| {% endfor %}
|
| }
|
| - return enabledProperties->get(property - {{first_enum_value - 1}});
|
| +
|
| + if (unresolvedProperty >= {{first_enum_value}})
|
| + return enabledProperties->get(property - {{first_enum_value}});
|
| +
|
| + if (unresolvedProperty == CSSPropertyVariable)
|
| + return RuntimeEnabledFeatures::cssVariablesEnabled();
|
| + ASSERT(unresolvedProperty == CSSPropertyApplyAtRule);
|
| + return RuntimeEnabledFeatures::cssApplyAtRulesEnabled();
|
| }
|
|
|
| void CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector(const CSSPropertyID* properties, size_t propertyCount, Vector<CSSPropertyID>& outVector)
|
|
|