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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 333423005: [CSS Grid Layout] Implement 'justify-items' parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Suggested changes and additional test cases. Created 6 years, 6 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: 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..7cb7dc4dd13d3b313a2196ffb6a6b90e7f4f2fe0 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_alignment1(property_id, alignment_type) %}
cbiesinger 2014/06/21 00:45:23 That is a terrible name for this macro. Please ren
+{{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
+ // also set it in the initial and inherit handlers
+ }
+}
+{% endmacro %}
+{{apply_alignment1('CSSPropertyJustifyItems', 'JustifyItems')}}
+
{% macro apply_svg_paint(property_id, paint_type) %}
{% set property = properties[property_id] %}
{{declare_initial_function(property_id)}}

Powered by Google App Engine
This is Rietveld 408576698