[css-align] Adapt content-alignment properties to the new baseline syntax
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:27:09 +0000 (21:27 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:27:09 +0000 (21:27 +0000)
commitd0b58e588a0ecb7c6374f32bb34c3d4e62de3f5d
tree5f18621c07dfe63e3ba255ebb81b75f97b3aba74
parentedbfc31359eb819cd9842fa4e47bc2a2ba2a8dae
[css-align] Adapt content-alignment properties to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170262

Reviewed by David Hyatt.

Source/WebCore:

The baseline-position syntax has changed recently, so we need to update
the CSS properties using the old syntax. This patch address only the
content-alignment (align-content and justify-content).

I used this patch to adapt the implementation of the parsing logic for
these properties to the new Blink's CSS Parsing Design.

The new baseline syntax is "[first | last ]? baseline" which implies
modifying the parsing and computed value logic.

There are several layout tests affected by this change, so I'll update
them accordingly.

No new tests, just added/modified some cases to the tests we
already have using the new baseline values.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator ItemPosition):
(WebCore::CSSPrimitiveValue::operator ContentPosition):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):

LayoutTests:

Added new cases to the alignment properties parsing tests so that we can verify the new
baseline-alignment syntax is parsed as expected.
Additionally, I modified the tests so that they use the testharness format.

* css3/parse-align-content-expected.txt:
* css3/parse-align-content.html:
* css3/parse-justify-content-expected.txt:
* css3/parse-justify-content.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
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
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSContentDistributionValue.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSPropertyParser.cpp