[CSS Box Alignment] New CSS Value 'normal' for Content Alignment
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2016 11:05:32 +0000 (11:05 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2016 11:05:32 +0000 (11:05 +0000)
commit30c9cc0199d188538c7e4427f80a9fa829f8a50d
treedde494fcedfb30915c7cb5122f673ec005d533af
parenta41bc225aedb0edfb1cf9c8edaab07500583117b
[CSS Box Alignment] New CSS Value 'normal' for Content Alignment
https://bugs.webkit.org/show_bug.cgi?id=154282

Source/WebCore:

Reviewed by David Hyatt.

The Box Alignment specification defines a new value 'normal' to be used
as default for the different layout models, which will define the
specific behavior for each case. This patch adds a new CSS value in the
parsing logic and adapts the Content Alignment properties to the new
value.

The 'auto' value is no longer valid and the Computed Value will be
always the specified value. Hence, I removed the StyleResolver logic
because is not required now; the specific behavior of the 'normal'
value will be resolved at layout time.

Computed value of both align-content and justify-content is the
specified value, we don't have to resolve any 'auto' value now.

Additionally, this patch updates the layout logic as well, for both
Flexbox and Grid layout models.

No new tests, since we only need to rebaseline those test cases
affected by the new default computed value.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Deleted.
(WebCore::CSSComputedStyleDeclaration::copyProperties): Deleted.
(WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::isFlexOrGrid): Deleted.
(WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseContentDistributionOverflowPosition):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ContentPosition):
* rendering/RenderFlexibleBox.cpp:
(WebCore::normalValueBehavior):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::alignFlexLines):
(WebCore::alignContentSpaceBetweenChildren): Deleted.
* rendering/RenderGrid.cpp:
(WebCore::normalValueBehavior):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::resolveContentDistributionFallback):
(WebCore::contentDistributionOffset):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
* rendering/style/RenderStyle.cpp:
(WebCore::resolvedContentAlignmentPosition):
(WebCore::resolvedContentAlignmentDistribution):
(WebCore::RenderStyle::resolvedJustifyContentPosition):
(WebCore::RenderStyle::resolvedJustifyContentDistribution):
(WebCore::RenderStyle::resolvedAlignContentPosition):
(WebCore::RenderStyle::resolvedAlignContentDistribution):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:

LayoutTests:

The Box Alignment specification defines a new value 'normal' to be used
as default for the different layout models, which will define the
specific behavior for each case. This patch adds a new CSS value in the
parsing logic and adapts the Content Alignment properties to the new
value.

Since the 'normal' vlaue, initial/default for both justify-content
and align-content CSS properties, behaves now as 'stretch' instead
of o'start' we have to rebaseline those tests affected by the new
default value.

Reviewed by David Hyatt.

* css3/flexbox/css-properties-expected.txt:
* css3/flexbox/css-properties.html:
* css3/parse-align-content-expected.txt:
* css3/parse-align-content.html:
* css3/parse-justify-content-expected.txt:
* css3/parse-justify-content.html:
* css3/resources/alignment-parsing-utils.js:
(checkBadValues):
* fast/css-grid-layout/auto-content-resolution-columns.html:
* fast/css-grid-layout/grid-auto-columns-rows-update.html:
* fast/css-grid-layout/grid-auto-flow-resolution.html:
* fast/css-grid-layout/grid-columns-rows-get-set-multiple.html:
* fast/css-grid-layout/grid-columns-rows-get-set.html:
* fast/css-grid-layout/grid-container-change-named-grid-lines-recompute-child.html:
* fast/css-grid-layout/grid-content-sized-columns-resolution.html:
* fast/css-grid-layout/grid-dynamic-updates-relayout.html:
* fast/css-grid-layout/grid-element-min-max-width.html:
* fast/css-grid-layout/grid-element-repeat-get-set.html:
* fast/css-grid-layout/grid-initialize-span-one-items.html:
* fast/css-grid-layout/grid-item-addition-auto-placement-update.html:
* fast/css-grid-layout/grid-item-addition-track-breadth-update.html:
* fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-ltr.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-ltr.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl.html:
* fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html:
* fast/css-grid-layout/grid-item-named-grid-area-resolution.html:
* fast/css-grid-layout/grid-item-negative-indexes.html:
* fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html:
* fast/css-grid-layout/grid-item-removal-auto-placement-update.html:
* fast/css-grid-layout/grid-item-removal-track-breadth-update.html:
* fast/css-grid-layout/grid-update-sizes-after-distributing-all.html:
* fast/css-grid-layout/implicit-columns-auto-resolution.html:
* fast/css-grid-layout/implicit-position-dynamic-change.html:
* fast/css-grid-layout/mark-as-infinitely-growable.html:
* fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html:
* fast/css-grid-layout/minmax-spanning-resolution-columns.html:
* fast/css-grid-layout/named-grid-line-get-set.html:
* fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html:
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:
* fast/css-grid-layout/percent-intrinsic-track-breadth.html:
* fast/css-grid-layout/percent-track-breadths-regarding-container-size.html:
* fast/css-grid-layout/resources/grid-definitions-parsing-utils.js:
(checkGridTemplatesSetJSValues):
* fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js:
(checkGridDefinitionsSetJSValues):
(testGridDefinitionsSetBadJSValues):
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
57 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/css-properties-expected.txt
LayoutTests/css3/flexbox/css-properties.html
LayoutTests/css3/parse-align-content-expected.txt
LayoutTests/css3/parse-align-content.html
LayoutTests/css3/parse-justify-content-expected.txt
LayoutTests/css3/parse-justify-content.html
LayoutTests/css3/resources/alignment-parsing-utils.js
LayoutTests/fast/css-grid-layout/auto-content-resolution-columns.html
LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-update.html
LayoutTests/fast/css-grid-layout/grid-auto-flow-resolution.html
LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html
LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html
LayoutTests/fast/css-grid-layout/grid-container-change-named-grid-lines-recompute-child.html
LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution.html
LayoutTests/fast/css-grid-layout/grid-dynamic-updates-relayout.html
LayoutTests/fast/css-grid-layout/grid-element-min-max-width.html
LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set.html
LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html
LayoutTests/fast/css-grid-layout/grid-item-addition-auto-placement-update.html
LayoutTests/fast/css-grid-layout/grid-item-addition-track-breadth-update.html
LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-ltr.html
LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl.html
LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-ltr.html
LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl.html
LayoutTests/fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html
LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html
LayoutTests/fast/css-grid-layout/grid-item-negative-indexes.html
LayoutTests/fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html
LayoutTests/fast/css-grid-layout/grid-item-removal-auto-placement-update.html
LayoutTests/fast/css-grid-layout/grid-item-removal-track-breadth-update.html
LayoutTests/fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
LayoutTests/fast/css-grid-layout/implicit-columns-auto-resolution.html
LayoutTests/fast/css-grid-layout/implicit-position-dynamic-change.html
LayoutTests/fast/css-grid-layout/mark-as-infinitely-growable.html
LayoutTests/fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html
LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-columns.html
LayoutTests/fast/css-grid-layout/named-grid-line-get-set.html
LayoutTests/fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html
LayoutTests/fast/css-grid-layout/percent-intrinsic-track-breadth.html
LayoutTests/fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
LayoutTests/fast/css-grid-layout/resources/grid-definitions-parsing-utils.js
LayoutTests/fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h