Index: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
index 25853f8c9e4e99feba4c022882a5823e29ecd179..1f8925cf6207e24574a7b7ca6275a4aeb5b0cb8b 100644 |
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
@@ -523,6 +523,29 @@ namespace WebCore { |
{{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} |
{{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} |
+{% macro apply_alignment_with_legacy_keyword(property_id, alignment_type) %} |
+{{declare_value_function(property_id)}} |
+{ |
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
+ if (Pair* pairValue = primitiveValue->getPairValue()) { |
+ if (pairValue->first()->getValueID() == CSSValueLegacy) { |
+ state.style()->set{{alignment_type}}IsLegacy(true); |
+ state.style()->set{{alignment_type}}(*pairValue->second()); |
+ } else { |
+ state.style()->set{{alignment_type}}IsLegacy(false); |
+ state.style()->set{{alignment_type}}(*pairValue->first()); |
+ state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second()); |
+ } |
+ } else { |
+ state.style()->set{{alignment_type}}IsLegacy(false); |
+ state.style()->set{{alignment_type}}(*primitiveValue); |
+ // FIXME: We should clear the overflow-alignment mode here and probably |
Julien - ping for review
2014/06/24 19:04:56
Is this FIXME still required as you have testing f
jfernandez
2014/06/26 12:58:44
Done.
|
+ // also set it in the initial and inherit handlers |
+ } |
+} |
+{% endmacro %} |
+{{apply_alignment_with_legacy_keyword('CSSPropertyJustifyItems', 'JustifyItems')}} |
+ |
{% macro apply_svg_paint(property_id, paint_type) %} |
{% set property = properties[property_id] %} |
{{declare_initial_function(property_id)}} |