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

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

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased and got back previous setter names. Created 5 years, 8 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 | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 acd64789bb50241ff347b55003f9130dbc12af0c..da95da69b3f99c926d7968be98e19f9dd816f8fe 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -497,70 +497,6 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt
{{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}}
{{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}}
-{% macro apply_alignment(property_id, alignment_type) %}
-{% set property = properties[property_id] %}
-{{declare_initial_function(property_id)}}
-{
- state.style()->set{{alignment_type}}(ComputedStyle::initial{{alignment_type}}());
- state.style()->set{{alignment_type}}OverflowAlignment(ComputedStyle::initial{{alignment_type}}OverflowAlignment());
-}
-
-{{declare_inherit_function(property_id)}}
-{
- state.style()->set{{alignment_type}}(state.parentStyle()->{{property.getter}}());
- state.style()->set{{alignment_type}}OverflowAlignment(state.parentStyle()->{{property.getter}}OverflowAlignment());
-}
-
-{{declare_value_function(property_id)}}
-{
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (Pair* pairValue = primitiveValue->getPairValue()) {
- state.style()->set{{alignment_type}}(*pairValue->first());
- state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second());
- } else {
- state.style()->set{{alignment_type}}(*primitiveValue);
- state.style()->set{{alignment_type}}OverflowAlignment(ComputedStyle::initial{{alignment_type}}OverflowAlignment());
- }
-}
-{% endmacro %}
-{{apply_alignment('CSSPropertyJustifySelf', 'JustifySelf')}}
-{{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}}
-{{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}}
-
-{% macro apply_content_alignment(property_id, alignment_type) %}
-{% set property = properties[property_id] %}
-{{declare_initial_function(property_id)}}
-{
- state.style()->set{{alignment_type}}(ComputedStyle::initial{{alignment_type}}());
- state.style()->set{{alignment_type}}OverflowAlignment(ComputedStyle::initial{{alignment_type}}OverflowAlignment());
- state.style()->set{{alignment_type}}Distribution(ComputedStyle::initial{{alignment_type}}Distribution());
-}
-
-{{declare_inherit_function(property_id)}}
-{
- state.style()->set{{alignment_type}}(state.parentStyle()->{{property.getter}}());
- state.style()->set{{alignment_type}}OverflowAlignment(state.parentStyle()->{{property.getter}}OverflowAlignment());
- state.style()->set{{alignment_type}}Distribution(state.parentStyle()->{{property.getter}}Distribution());
-}
-
-{{declare_value_function(property_id)}}
-{
- state.style()->set{{alignment_type}}(ComputedStyle::initial{{alignment_type}}());
- state.style()->set{{alignment_type}}OverflowAlignment(ComputedStyle::initial{{alignment_type}}OverflowAlignment());
- state.style()->set{{alignment_type}}Distribution(ComputedStyle::initial{{alignment_type}}Distribution());
-
- CSSContentDistributionValue* contentValue = toCSSContentDistributionValue(value);
- if (contentValue->distribution()->getValueID() != CSSValueInvalid)
- state.style()->set{{alignment_type}}Distribution(*contentValue->distribution());
- if (contentValue->position()->getValueID() != CSSValueInvalid)
- state.style()->set{{alignment_type}}(*contentValue->position());
- if (contentValue->overflow()->getValueID() != CSSValueInvalid)
- state.style()->set{{alignment_type}}OverflowAlignment(*contentValue->overflow());
-}
-{% endmacro %}
-{{apply_content_alignment('CSSPropertyJustifyContent', 'JustifyContent')}}
-{{apply_content_alignment('CSSPropertyAlignContent', 'AlignContent')}}
-
{% macro apply_svg_paint(property_id, paint_type) %}
{% set property = properties[property_id] %}
{{declare_initial_function(property_id)}}
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698