mirror of
https://github.com/servo/servo.git
synced 2025-06-23 08:34:42 +01:00
87 lines
No EOL
3.6 KiB
HTML
87 lines
No EOL
3.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<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" type="text/javascript"></script>
|
|
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
|
|
<style type="text/css">
|
|
#grid {
|
|
display: grid;
|
|
}
|
|
|
|
#inline-grid {
|
|
display: inline-grid;
|
|
}
|
|
|
|
.inline-table {
|
|
display: inline-table;
|
|
}
|
|
|
|
.inline {
|
|
display: inline;
|
|
}
|
|
|
|
.flex {
|
|
display: flex;
|
|
}
|
|
|
|
.float {
|
|
float: left;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<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 type="text/javascript">
|
|
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>
|
|
</body>
|
|
</html> |