[css-align] 'overflow' keyword must precede the self-position and content-position...
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 17:01:51 +0000 (17:01 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 17:01:51 +0000 (17:01 +0000)
commit294315c5beb6c697d3f7767126cfc7c412be9d83
tree356da1df80a555cb8766976b8bc3850f06fc7241
parent8360e856bc2beff1c7a90e535bcc13daad060a72
[css-align] 'overflow' keyword must precede the self-position and content-position value
https://bugs.webkit.org/show_bug.cgi?id=181793

Reviewed by Antti Koivisto.

Source/WebCore:

There were several discussions to avoid ambiguities with the complex
values, specially when it comes to define the place-xxx shorthands.

One of the sources of problems is the 'overflow-position' keyword. The
CSS WG has decided to change the syntax of all the CSS Box Alignment
properties so that the 'overflow-position' keyword always precede the
'self-position' or the 'content-position' keywords.

https://github.com/w3c/csswg-drafts/issues/1446#event-1125715434

In order to apply this change to the Content Distribution properties'
(align-content and justify-content) syntax I had to completely
re-implement their parsing function. Thanks to this I addressed also
the issue with the content-distribution fallback, which cannot be
specified explicitly now.

https://github.com/w3c/csswg-drafts/issues/1002#ref-commit-c38cac4

No new tests, just rebaselined the expected results of the test cases affected.

Despite the so many layout tests affected by this change, it's
unlikely that it might break any content in current web
sites. This patch changes the new CSS syntax, obviously backward
compatible, defined by the new CSS Box Alignment. The
'overflow-position' keyword is only used by the layout models
implementing the new spec, so far only CSS Grid Layout.
Considering that CSS Grid has been shipped last year, it's unlikely
that many sites are using the new CSS values.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeOverflowPositionKeyword):
(WebCore::consumeContentPositionKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):

LayoutTests:

Rebaseline expected results of the test cases affected by this change.

* css3/parse-align-content.html:
* css3/parse-align-items.html:
* css3/parse-align-self.html:
* css3/parse-justify-content.html:
* css3/overwrite-self-alignment.html:
* css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html:
* css3/overwrite-content-alignment.html:
* fast/css-grid-layout/grid-content-alignment-overflow.html:
* fast/css-grid-layout/grid-align-justify-overflow.html:
* fast/css/parse-justify-items.html:
* fast/css/parse-justify-self.html:
* fast/repaint/align-items-overflow-change.html:
* fast/repaint/align-self-overflow-change.html:
* fast/repaint/justify-items-overflow-change.html:
* fast/repaint/justify-self-overflow-change.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html
LayoutTests/css3/overwrite-content-alignment-expected.txt
LayoutTests/css3/overwrite-content-alignment.html
LayoutTests/css3/overwrite-self-alignment-expected.txt
LayoutTests/css3/overwrite-self-alignment.html
LayoutTests/css3/parse-align-content.html
LayoutTests/css3/parse-align-items.html
LayoutTests/css3/parse-align-self.html
LayoutTests/css3/parse-justify-content.html
LayoutTests/fast/css-grid-layout/resources/grid-alignment.css
LayoutTests/fast/css/parse-justify-items.html
LayoutTests/fast/css/parse-justify-self.html
LayoutTests/fast/repaint/align-items-overflow-change.html
LayoutTests/fast/repaint/align-self-overflow-change.html
LayoutTests/fast/repaint/justify-items-overflow-change.html
LayoutTests/fast/repaint/justify-self-overflow-change.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSContentDistributionValue.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSPropertyParser.cpp