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

Unified Diff: Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl

Issue 22610005: Implement runtime feature support for CSS Shorthands (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
« no previous file with comments | « Source/core/scripts/make_style_shorthands.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
diff --git a/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl b/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
index 8c8c16a843880559415389af8ba007b8442d9902..a491e03c0ad856c194d92b4328bffc89e886faa8 100644
--- a/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
+++ b/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
@@ -21,6 +21,7 @@
#include "config.h"
#include "StylePropertyShorthand.h"
+#include "RuntimeEnabledFeatures.h"
#include "wtf/HashMap.h"
#include "wtf/StdLibExtras.h"
@@ -44,15 +45,19 @@ const StylePropertyShorthand& {{ property.camel_case_name }}Shorthand()
// Returns an empty list if the property is not a shorthand
const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID)
{
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, emptyShorthand, ());
switch (propertyID) {
{%- for property_id, property in properties.items() %}
{%- if property.camel_case_name not in ["width", "height", "marker"] %}
case {{ property_id }}:
+ {%- if property.runtime_conditional_getter %}
+ if (!RuntimeEnabledFeatures::{{ property.runtime_conditional_getter }}())
+ return emptyShorthand;
+ {%- endif %}
return {{ property.camel_case_name }}Shorthand();
{%- endif %}
{%- endfor %}
default: {
- DEFINE_STATIC_LOCAL(StylePropertyShorthand, emptyShorthand, ());
return emptyShorthand;
}
}
« no previous file with comments | « Source/core/scripts/make_style_shorthands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698