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..c521b53d5361084fa7e12419a225ce8641e6f8d9 100644 |
--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl |
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl |
@@ -26,18 +26,24 @@ 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) |
Timothy Loh
2015/11/14 02:21:05
Where are we calling into here from? It looks like
leviw_travelin_and_unemployed
2015/11/17 01:25:07
That's right, and we check this when trying to set
|
{ |
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); |
{% 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}}); |