Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit c115986

Browse files
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] w3c/csswg-drafts#440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent b414103 commit c115986

31 files changed

+678
-504
lines changed

LayoutTests/ChangeLog

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2017-07-10 Javier Fernandez <[email protected]>
2+
3+
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
4+
https://bugs.webkit.org/show_bug.cgi?id=172707
5+
6+
Reviewed by Antti Koivisto.
7+
8+
Updated layout tests so that resolved value is as specified, even for 'auto' values.
9+
10+
* TestExpectations:
11+
* css3/flexbox/css-properties-expected.txt:
12+
* css3/flexbox/css-properties.html:
13+
* css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt:
14+
* css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html:
15+
* css3/parse-align-self.html:
16+
* css3/parse-alignment-of-root-elements-expected.txt:
17+
* css3/parse-alignment-of-root-elements.html:
18+
* css3/parse-place-items.html:
19+
* css3/parse-place-self.html:
20+
* fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt:
21+
* fast/css/parse-justify-self.html:
22+
123
2017-07-10 Myles C. Maxfield <[email protected]>
224

325
fast/text/trak-optimizeLegibility.html is failing on macOS High Sierra

LayoutTests/TestExpectations

+3
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ imported/w3c/web-platform-tests/IndexedDB/clone-before-keypath-eval.html [ Pass
296296
imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html [ Pass Failure ]
297297
imported/w3c/web-platform-tests/fetch/dangling-markup-mitigation.tentative.html [ Pass Failure ]
298298

299+
# css alignment tests
300+
webkit.org/b/172711 css3/parse-alignment-of-root-elements.html [ Failure ]
301+
299302
# selectors4
300303
webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors4/selectors-dir-selector-ltr-001.html [ ImageOnlyFailure ]
301304
webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors4/selectors-dir-selector-rtl-001.html [ ImageOnlyFailure ]

LayoutTests/css3/flexbox/css-properties-expected.txt

+15-15
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ PASS window.getComputedStyle(flexbox, null).justifyContent is "space-evenly"
3131
PASS flexbox.style.justifyContent is ""
3232
PASS window.getComputedStyle(flexbox, null).justifyContent is "normal"
3333
PASS flexbox.style.alignSelf is ""
34-
PASS window.getComputedStyle(flexbox, null).alignSelf is "normal"
35-
PASS window.getComputedStyle(document.documentElement, null).alignSelf is "normal"
34+
PASS window.getComputedStyle(flexbox, null).alignSelf is "auto"
35+
PASS window.getComputedStyle(document.documentElement, null).alignSelf is "auto"
3636
PASS flexbox.style.alignSelf is ""
37-
PASS window.getComputedStyle(flexbox, null).alignSelf is "normal"
37+
PASS window.getComputedStyle(flexbox, null).alignSelf is "auto"
3838
PASS flexbox.style.alignSelf is "auto"
39-
PASS window.getComputedStyle(flexbox, null).alignSelf is "normal"
39+
PASS window.getComputedStyle(flexbox, null).alignSelf is "auto"
4040
PASS flexbox.style.alignSelf is "flex-start"
4141
PASS window.getComputedStyle(flexbox, null).alignSelf is "flex-start"
4242
PASS flexbox.style.alignSelf is "flex-end"
@@ -48,41 +48,41 @@ PASS window.getComputedStyle(flexbox, null).alignSelf is "stretch"
4848
PASS flexbox.style.alignSelf is "baseline"
4949
PASS window.getComputedStyle(flexbox, null).alignSelf is "baseline"
5050
PASS flexbox.style.alignSelf is ""
51-
PASS window.getComputedStyle(flexbox, null).alignSelf is "normal"
51+
PASS window.getComputedStyle(flexbox, null).alignSelf is "auto"
5252
PASS flexbox.style.alignItems is ""
5353
PASS flexitem.style.alignSelf is ""
5454
PASS window.getComputedStyle(flexbox, null).alignItems is "normal"
55-
PASS window.getComputedStyle(flexitem, null).alignSelf is "normal"
55+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
5656
PASS flexbox.style.alignItems is ""
5757
PASS flexitem.style.alignSelf is ""
5858
PASS window.getComputedStyle(flexbox, null).alignItems is "normal"
59-
PASS window.getComputedStyle(flexitem, null).alignSelf is "normal"
59+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
6060
PASS flexbox.style.alignItems is ""
6161
PASS flexitem.style.alignSelf is ""
6262
PASS window.getComputedStyle(flexbox, null).alignItems is "normal"
63-
PASS window.getComputedStyle(flexitem, null).alignSelf is "normal"
63+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
6464
PASS flexbox.style.alignItems is "flex-start"
6565
PASS flexitem.style.alignSelf is ""
6666
PASS window.getComputedStyle(flexbox, null).alignItems is "flex-start"
67-
PASS window.getComputedStyle(flexitem, null).alignSelf is "flex-start"
67+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
6868
PASS flexbox.style.alignItems is "flex-end"
6969
PASS window.getComputedStyle(flexbox, null).alignItems is "flex-end"
70-
PASS window.getComputedStyle(flexitem, null).alignSelf is "flex-end"
70+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
7171
PASS flexbox.style.alignItems is "center"
7272
PASS window.getComputedStyle(flexbox, null).alignItems is "center"
73-
PASS window.getComputedStyle(flexitem, null).alignSelf is "center"
73+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
7474
PASS flexbox.style.alignItems is "stretch"
7575
PASS window.getComputedStyle(flexbox, null).alignItems is "stretch"
76-
PASS window.getComputedStyle(flexitem, null).alignSelf is "stretch"
76+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
7777
PASS flexbox.style.alignItems is "baseline"
7878
PASS window.getComputedStyle(flexbox, null).alignItems is "baseline"
79-
PASS window.getComputedStyle(flexitem, null).alignSelf is "baseline"
79+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
8080
PASS flexbox.style.alignItems is ""
8181
PASS window.getComputedStyle(flexbox, null).alignItems is "normal"
82-
PASS window.getComputedStyle(flexitem, null).alignSelf is "normal"
82+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
8383
PASS flexbox.style.alignItems is ""
8484
PASS window.getComputedStyle(flexbox, null).alignItems is "normal"
85-
PASS window.getComputedStyle(flexitem, null).alignSelf is "normal"
85+
PASS window.getComputedStyle(flexitem, null).alignSelf is "auto"
8686
PASS window.getComputedStyle(detachedFlexbox, null).alignSelf is ""
8787
PASS window.getComputedStyle(detachedFlexItem, null).alignSelf is ""
8888
PASS flexbox.style.flexDirection is ""

LayoutTests/css3/flexbox/css-properties.html

+17-17
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@
8484
shouldBeEqualToString('window.getComputedStyle(flexbox, null).justifyContent', 'normal');
8585

8686
shouldBeEqualToString('flexbox.style.alignSelf', '');
87-
// The initial value is 'auto', which will be resolved depending on parent's style (except for the 'document' element).
88-
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'normal');
89-
shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).alignSelf', 'normal');
87+
// The initial value is 'auto'.
88+
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'auto');
89+
shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).alignSelf', 'auto');
9090

9191
flexbox.style.alignSelf = 'foo';
9292
shouldBeEqualToString('flexbox.style.alignSelf', '');
93-
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'normal');
93+
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'auto');
9494

9595
flexbox.style.alignSelf = 'auto';
9696
shouldBeEqualToString('flexbox.style.alignSelf', 'auto');
97-
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'normal');
97+
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'auto');
9898

9999
flexbox.style.alignSelf = 'flex-start';
100100
shouldBeEqualToString('flexbox.style.alignSelf', 'flex-start');
@@ -118,62 +118,62 @@
118118

119119
flexbox.style.alignSelf = '';
120120
shouldBeEqualToString('flexbox.style.alignSelf', '');
121-
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'normal');
121+
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignSelf', 'auto');
122122

123123
shouldBeEqualToString('flexbox.style.alignItems', '');
124124
shouldBeEqualToString('flexitem.style.alignSelf', '');
125-
// The initial value is 'auto', which will be resolved to 'normal' in case of flexbox containers.
125+
// The initial value is 'auto'.
126126
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'normal');
127-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'normal');
127+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
128128

129129
flexbox.style.alignItems = 'foo';
130130
shouldBeEqualToString('flexbox.style.alignItems', '');
131131
shouldBeEqualToString('flexitem.style.alignSelf', '');
132132
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'normal');
133-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'normal');
133+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
134134

135135
// The 'auto' value is not valid for the align-items property.
136136
flexbox.style.alignItems = 'auto';
137137
shouldBeEqualToString('flexbox.style.alignItems', '');
138138
shouldBeEqualToString('flexitem.style.alignSelf', '');
139139
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'normal');
140-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'normal');
140+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
141141

142142
flexbox.style.alignItems = 'flex-start';
143143
shouldBeEqualToString('flexbox.style.alignItems', 'flex-start');
144144
shouldBeEqualToString('flexitem.style.alignSelf', '');
145145
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'flex-start');
146-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'flex-start');
146+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
147147

148148
flexbox.style.alignItems = 'flex-end';
149149
shouldBeEqualToString('flexbox.style.alignItems', 'flex-end');
150150
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'flex-end');
151-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'flex-end');
151+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
152152

153153
flexbox.style.alignItems = 'center';
154154
shouldBeEqualToString('flexbox.style.alignItems', 'center');
155155
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'center');
156-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'center');
156+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
157157

158158
flexbox.style.alignItems = 'stretch';
159159
shouldBeEqualToString('flexbox.style.alignItems', 'stretch');
160160
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'stretch');
161-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'stretch');
161+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
162162

163163
flexbox.style.alignItems = 'baseline';
164164
shouldBeEqualToString('flexbox.style.alignItems', 'baseline');
165165
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'baseline');
166-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'baseline');
166+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
167167

168168
flexbox.style.alignItems = '';
169169
shouldBeEqualToString('flexbox.style.alignItems', '');
170170
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'normal');
171-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'normal');
171+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
172172

173173
flexbox.style.display = 'none';
174174
shouldBeEqualToString('flexbox.style.alignItems', '');
175175
shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignItems', 'normal');
176-
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'normal');
176+
shouldBeEqualToString('window.getComputedStyle(flexitem, null).alignSelf', 'auto');
177177
flexbox.style.display = 'flex';
178178

179179

Original file line numberDiff line numberDiff line change
@@ -1,57 +1,8 @@
11
Test to verify that the new alignment values are parsed as invalid if Grid Layout is disabled and in any case they do not cause a crash because assertions in flexbox layout code.
22

3-
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
43

5-
6-
7-
New alignment values should be invalid when grid layout is disabled
8-
9-
Testing Self-Alignment values.
10-
PASS alignSelf is 'flex-start'
11-
PASS alignSelf is 'flex-start'
12-
PASS alignSelf is 'flex-start'
13-
PASS alignSelf is 'flex-start'
14-
PASS alignSelf is 'flex-start'
15-
PASS alignSelf is 'flex-start'
16-
17-
Testing Default-Alignment values.
18-
PASS alignItems is 'flex-end'
19-
PASS alignSelf is 'flex-end'
20-
PASS alignItems is 'flex-end'
21-
PASS alignSelf is 'flex-end'
22-
PASS alignItems is 'flex-end'
23-
PASS alignSelf is 'flex-end'
24-
PASS alignItems is 'flex-end'
25-
PASS alignSelf is 'flex-end'
26-
PASS alignItems is 'flex-end'
27-
PASS alignSelf is 'flex-end'
28-
PASS alignItems is 'flex-end'
29-
PASS alignSelf is 'flex-end'
30-
31-
Even when grid layout is enabled, new values should not violate assertions in FlexibleBox layout logic.
32-
33-
Testing Self-Alignment values.
34-
PASS alignSelf is 'start unsafe'
35-
PASS alignSelf is 'start'
36-
PASS alignSelf is 'end'
37-
PASS alignSelf is 'flex-start safe'
38-
PASS alignSelf is 'self-start'
39-
PASS alignSelf is 'self-end'
40-
41-
Testing Default-Alignment values.
42-
PASS alignItems is 'start unsafe'
43-
PASS alignSelf is 'start unsafe'
44-
PASS alignItems is 'start'
45-
PASS alignSelf is 'start'
46-
PASS alignItems is 'end'
47-
PASS alignSelf is 'end'
48-
PASS alignItems is 'flex-start safe'
49-
PASS alignSelf is 'flex-start safe'
50-
PASS alignItems is 'self-start'
51-
PASS alignSelf is 'self-start'
52-
PASS alignItems is 'self-end'
53-
PASS alignSelf is 'self-end'
54-
PASS successfullyParsed is true
55-
56-
TEST COMPLETE
4+
PASS New Self-Alignment values should be invalid when grid layout is DISABLED.
5+
PASS New Default-Alignment values should be invalid when grid layout is DISABLED.
6+
PASS Even when grid layout is ENABLED, new Self-Alignment values should not violate assertions in FlexibleBox layout logic..
7+
PASS Even when grid layout is ENABLED, new Default-Alignment values should not violate assertions in FlexibleBox layout logic..
578

Original file line numberDiff line numberDiff line change
@@ -1,73 +1,89 @@
11
<!DOCTYPE html>
2-
<div id="flexContainer" style="display: flex">
3-
<div id="flexItem"></div>
4-
</div>
5-
<script src="../../resources/js-test.js"></script>
2+
<script src="../../resources/testharness.js"></script>
3+
<script src="../../resources/testharnessreport.js"></script>
4+
<script src="../resources/alignment-parsing-utils-th.js"></script>
5+
<html>
6+
<body>
7+
<p>Test to verify that the new alignment values are parsed as invalid if Grid Layout is disabled and in any case they do not cause a crash because assertions in flexbox layout code.</p>
8+
<div id="log"></div>
9+
10+
<div id="flexContainer" style="display: flex">
11+
<div id="flexItem"></div>
12+
</div>
613
<script>
7-
description('Test to verify that the new alignment values are parsed as invalid if Grid Layout is disabled and in any case they do not cause a crash because assertions in flexbox layout code.');
14+
15+
var container = document.getElementById("flexContainer");
16+
var item = document.getElementById("flexItem");
817

918
function checkAlignSelfValue(value, computedValue, gridEnabled)
1019
{
1120
item.style.webkitAlignSelf = value;
12-
alignSelf = getComputedStyle(item, '').getPropertyValue('-webkit-align-self');
1321
if (gridEnabled)
14-
shouldBe("alignSelf", computedValue);
22+
checkValues(item, "alignSelf", "align-self", value, computedValue);
1523
else
16-
shouldBe("alignSelf", "'flex-start'");
24+
checkValues(item, "alignSelf", "align-self", "flex-start", "flex-start");
1725
}
1826

1927
function checkAlignItemsValue(value, computedValue, gridEnabled)
2028
{
2129
container.style.webkitAlignItems = value;
22-
alignItems = getComputedStyle(container, '').getPropertyValue('-webkit-align-items');
23-
alignSelf = getComputedStyle(item, '').getPropertyValue('-webkit-align-self');
2430
if (gridEnabled) {
25-
shouldBe("alignItems", computedValue);
26-
shouldBe("alignSelf", computedValue);
31+
checkValues(container, "alignItems", "align-items", value, computedValue);
32+
checkValues(item, "alignSelf", "align-self", "auto", "auto");
2733
} else {
28-
shouldBe("alignItems", "'flex-end'");
29-
shouldBe("alignSelf", "'flex-end'");
34+
checkValues(container, "alignItems", "align-items", "flex-end", "flex-end");
35+
checkValues(item, "alignSelf", "align-self", "auto", "auto");
3036
}
3137
}
3238

33-
function checkAlignmentValues(gridEnabled)
39+
function checkSelfAlignmentValues(gridEnabled)
3440
{
3541
if (window.internals)
36-
internals.settings.setCSSGridLayoutEnabled(gridEnabled);
42+
internals.settings.setCSSGridLayoutEnabled(gridEnabled)
3743

38-
debug('<br>Testing Self-Alignment values.');
39-
checkAlignSelfValue("start unsafe", "'start unsafe'", gridEnabled)
40-
checkAlignSelfValue("start", "'start'", gridEnabled)
41-
checkAlignSelfValue("end", "'end'", gridEnabled)
42-
checkAlignSelfValue("flex-start safe", "'flex-start safe'", gridEnabled)
43-
checkAlignSelfValue("self-start", "'self-start'", gridEnabled)
44-
checkAlignSelfValue("self-end", "'self-end'", gridEnabled)
44+
item.style.webkitAlignSelf = "flex-start";
4545

46-
item.style.webkitAlignSelf = "auto";
46+
checkAlignSelfValue("start unsafe", "start unsafe", gridEnabled)
47+
checkAlignSelfValue("start", "start", gridEnabled)
48+
checkAlignSelfValue("end", "end", gridEnabled)
49+
checkAlignSelfValue("flex-start safe", "flex-start safe", gridEnabled)
50+
checkAlignSelfValue("self-start", "self-start", gridEnabled)
51+
checkAlignSelfValue("self-end", "self-end", gridEnabled)
52+
}
4753

48-
debug('<br>Testing Default-Alignment values.');
49-
checkAlignItemsValue("start unsafe", "'start unsafe'", gridEnabled)
50-
checkAlignItemsValue("start", "'start'", gridEnabled)
51-
checkAlignItemsValue("end", "'end'", gridEnabled)
52-
checkAlignItemsValue("flex-start safe", "'flex-start safe'", gridEnabled)
53-
checkAlignItemsValue("self-start", "'self-start'", gridEnabled)
54-
checkAlignItemsValue("self-end", "'self-end'", gridEnabled)
54+
function checkDefaultAlignmentValues(gridEnabled)
55+
{
56+
if (window.internals)
57+
internals.settings.setCSSGridLayoutEnabled(gridEnabled)
5558

56-
item.style.webkitAlignSelf = "flex-start";
59+
container.style.webkitAlignItems = "flex-end";
60+
item.style.webkitAlignSelf = "auto";
61+
62+
checkAlignItemsValue("start unsafe", "start unsafe", gridEnabled)
63+
checkAlignItemsValue("start", "start", gridEnabled)
64+
checkAlignItemsValue("end", "end", gridEnabled)
65+
checkAlignItemsValue("flex-start safe", "flex-start safe", gridEnabled)
66+
checkAlignItemsValue("self-start", "self-start", gridEnabled)
67+
checkAlignItemsValue("self-end", "self-end", gridEnabled)
5768
}
5869

59-
var container = document.getElementById("flexContainer");
60-
var item = document.getElementById("flexItem");
70+
test(function() {
71+
checkSelfAlignmentValues(false);
72+
}, "New Self-Alignment values should be invalid when grid layout is DISABLED.");
6173

62-
container.style.webkitAlignItems = "flex-end";
63-
item.style.webkitAlignSelf = "flex-start";
64-
var alignSelf = "flex-start";
65-
var alignItems = "flex-start";
74+
test(function() {
75+
checkDefaultAlignmentValues(false);
76+
}, "New Default-Alignment values should be invalid when grid layout is DISABLED.");
6677

67-
debug('<br>New alignment values should be invalid when grid layout is disabled');
68-
checkAlignmentValues(false);
78+
test(function() {
79+
checkSelfAlignmentValues(true);
80+
}, "Even when grid layout is ENABLED, new Self-Alignment values should not violate assertions in FlexibleBox layout logic..");
6981

70-
debug('<br>Even when grid layout is enabled, new values should not violate assertions in FlexibleBox layout logic.');
71-
checkAlignmentValues(true);
82+
test(function() {
83+
checkDefaultAlignmentValues(true);
84+
}, "Even when grid layout is ENABLED, new Default-Alignment values should not violate assertions in FlexibleBox layout logic..");
7285

7386
</script>
87+
88+
</body>
89+
</html>

0 commit comments

Comments
 (0)