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

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

Issue 361113002: Properly managing overlfow-aligment for inherit and initial. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. 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
« no previous file with comments | « LayoutTests/fast/alignment/resources/alignment-parsing-utils.js ('k') | Source/core/css/CSSProperties.in » ('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 e0dba7d86c8e76e0ba1c65298cf9f59f2d6f1d3b..4e4f8dfbe31d586016239acddbd3d8d84a86fd30 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -554,6 +554,19 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt
{{apply_value_shape('CSSPropertyShapeOutside')}}
{% macro apply_alignment(property_id, alignment_type) %}
+{% set property = properties[property_id] %}
+{{declare_initial_function(property_id)}}
+{
+ state.style()->set{{alignment_type}}(RenderStyle::initial{{alignment_type}}());
+ state.style()->set{{alignment_type}}OverflowAlignment(RenderStyle::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);
@@ -569,25 +582,6 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt
{{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}}PositionType(LegacyPosition);
- state.style()->set{{alignment_type}}(*pairValue->second());
- } else {
- state.style()->set{{alignment_type}}(*pairValue->first());
- state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second());
- }
- } else {
- state.style()->set{{alignment_type}}(*primitiveValue);
- }
-}
-{% 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)}}
« no previous file with comments | « LayoutTests/fast/alignment/resources/alignment-parsing-utils.js ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698