Chromium Code Reviews| 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 9c822ae008617f43447a23f28d4ef0ee8cca0fb1..525c162e1a68986d042831eaea2ff35f240b5360 100644 |
| --- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl |
| +++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl |
| @@ -26,21 +26,27 @@ 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<numCSSProperties>* enabledProperties = 0; |
| + static BitArray<numValidPropertyIDs>* enabledProperties = 0; |
| if (!enabledProperties) { |
| - enabledProperties = new BitArray<numCSSProperties>(true); // All bits sets to 1. |
| + enabledProperties = new BitArray<numValidPropertyIDs>(true); // All bits sets to 1. |
| + if (!RuntimeEnabledFeatures::cssVariablesEnabled()) |
| + enabledProperties->clear(0); |
|
alancutter (OOO until 2018)
2015/11/23 05:23:59
Is this ever hit? It doesn't look like we will get
alancutter (OOO until 2018)
2015/11/23 21:55:33
We should ASSERT(CSSPropertyVariable == {{first_en
alancutter (OOO until 2018)
2015/11/23 22:20:47
s/ASSERT/static_assert/
|
| {% 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}}); |
| + enabledProperties->clear({{property_id}} - {{first_enum_value - 1}}); |
| {% endfor %} |
| {% for property_id, property in properties.items() if property.is_internal %} |
| - enabledProperties->clear({{property_id}} - {{first_enum_value}}); |
| + enabledProperties->clear({{property_id}} - {{first_enum_value - 1}}); |
| {% endfor %} |
| } |
| - return enabledProperties->get(property - {{first_enum_value}}); |
| + return enabledProperties->get(property - {{first_enum_value - 1}}); |
| } |
| void CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector(const CSSPropertyID* properties, size_t propertyCount, Vector<CSSPropertyID>& outVector) |