1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: 'float' affects to the computed value of 'display' on grid items</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-containers" title="3.1 Establishing Grid Containers">
<link rel="help" href="http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo" title="9.7 Relationships between 'display', 'position', and 'float'">
<meta name="flags" content="dom">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#grid {
display: grid;
}
#inline-grid {
display: inline-grid;
}
.inline-table {
display: inline-table;
}
.inline {
display: inline;
}
.flex {
display: flex;
}
.float {
float: left;
}
</style>
<div id="log"></div>
<div id="grid">
<div id="grid-inline-table" class="float inline-table"></div>
<div id="grid-inline" class="float inline"></div>
<div id="grid-flex" class="float flex"></div>
</div>
<div id="inline-grid">
<div id="inline-grid-inline-table" class="float inline-table"></div>
<div id="inline-grid-inline" class="float inline"></div>
<div id="inline-grid-flex" class="float flex"></div>
</div>
<script>
function testComputedStyleDisplay(element, value) {
assert_equals(getComputedStyle(element).getPropertyValue("display"), value, "getComputedStyle() display should be '" + value + "'");
}
var gridInlineTable = document.getElementById("grid-inline-table");
test(function() {
testComputedStyleDisplay(gridInlineTable, "table");
}, "Test display floated 'inline-table' grid item");
var gridInline = document.getElementById("grid-inline");
test(function() {
testComputedStyleDisplay(gridInline, "block");
}, "Test display floated 'inline' grid item");
var gridFlex = document.getElementById("grid-flex");
test(function() {
testComputedStyleDisplay(gridFlex, "flex");
}, "Test display floated 'flex' grid item");
var inlineGridInlineTable = document.getElementById("inline-grid-inline-table");
test(function() {
testComputedStyleDisplay(inlineGridInlineTable, "table");
}, "Test display floated 'inline-table' grid item within an inline grid");
var inlineGridInline = document.getElementById("inline-grid-inline");
test(function() {
testComputedStyleDisplay(inlineGridInline, "block");
}, "Test display floated 'inline' grid item within an inline grid");
var inlineGridFlex = document.getElementById("inline-grid-flex");
test(function() {
testComputedStyleDisplay(inlineGridFlex, "flex");
}, "Test display floated 'flex' grid item within an inline grid");
</script>
|