Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl

Issue 1645433002: Basic implementation of @apply (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix expted.txt for failing test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698