blob: 6d79cdcee3b73bf60bdcd3b01d8ef9fcf3566430 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>'columns' property with 'auto' and something else</title>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Test intrinsic width calculation for multicol. See http://dev.w3.org/csswg/css-sizing/#multicol-intrinsic");
if (window.testRunner)
testRunner.dumpAsText();
</script>
<style>
.gap15 { -webkit-column-gap:15px; column-gap:15px; }
.mc3 { -webkit-columns:3; columns:3; }
.mc3w50 { -webkit-columns:3 50px; columns:3 50px; }
.mc3w150 { -webkit-columns:3 150px; columns:3 150px; }
.mcw50 { -webkit-columns:50px; columns:50px; }
.mcw150 { -webkit-columns:150px; columns:150px; }
.intrinsic { width:intrinsic; }
</style>
</head>
<body>
<div style="visibility:hidden;"> <!-- hide garbage produced from &#x200b; characters -->
<!-- min intrinsic width, non-auto column-count -->
<div style="width:1px;">
<div id="elm01" class="intrinsic mc3 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count -->
<div style="width:1000px;">
<div id="elm02" class="intrinsic mc3 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, non-auto column-count, breakable lines -->
<div style="width:1px;">
<div id="elm03" class="intrinsic mc3 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count, breakable lines -->
<div style="width:1000px;">
<div id="elm04" class="intrinsic mc3 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, non-auto column-count and small column-width -->
<div style="width:1px;">
<div id="elm05" class="intrinsic mc3w50 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count and small column-width -->
<div style="width:1000px;">
<div id="elm06" class="intrinsic mc3w50 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, non-auto column-count and small column-width, breakable lines -->
<div style="width:1px;">
<div id="elm07" class="intrinsic mc3w50 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count and small column-width, breakable lines -->
<div style="width:1000px;">
<div id="elm08" class="intrinsic mc3w50 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, non-auto column-count and large column-width -->
<div style="width:1px;">
<div id="elm09" class="intrinsic mc3w150 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count and large column-width -->
<div style="width:1000px;">
<div id="elm10" class="intrinsic mc3w150 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, non-auto column-count and large column-width, breakable lines -->
<div style="width:1px;">
<div id="elm11" class="intrinsic mc3w150 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, non-auto column-count and large column-width, breakable lines -->
<div style="width:1000px;">
<div id="elm12" class="intrinsic mc3w150 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, auto column-count and small column-width -->
<div style="width:1px;">
<div id="elm13" class="intrinsic mcw50 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, auto column-count and small column-width -->
<div style="width:1000px;">
<div id="elm14" class="intrinsic mcw50 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, auto column-count and small column-width, breakable lines -->
<div style="width:1px;">
<div id="elm15" class="intrinsic mcw50 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, auto column-count and small column-width, breakable lines -->
<div style="width:1000px;">
<div id="elm16" class="intrinsic mcw50 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, auto column-count and large column-width -->
<div style="width:1px;">
<div id="elm17" class="intrinsic mcw150 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, auto column-count and large column-width -->
<div style="width:1000px;">
<div id="elm18" class="intrinsic mcw150 gap15">
<div style="width:100px; height:10px;"></div>
</div>
</div>
<!-- min intrinsic width, auto column-count and large column-width, breakable lines -->
<div style="width:1px;">
<div id="elm19" class="intrinsic mcw150 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
<!-- max intrinsic width, auto column-count and large column-width, breakable lines -->
<div style="width:1000px;">
<div id="elm20" class="intrinsic mcw150 gap15">
<div style="display:inline-block; width:100px; height:10px;"></div>&#x200b;<div style="display:inline-block; width:100px; height:10px;"></div>
</div>
</div>
</div>
<script>
// non-auto column-count
shouldBe("elm01.offsetWidth", "330");
shouldBe("elm02.offsetWidth", "330");
shouldBe("elm03.offsetWidth", "330");
shouldBe("elm04.offsetWidth", "630");
// non-auto column-count and small column-width
shouldBe("elm05.offsetWidth", "50");
shouldBe("elm06.offsetWidth", "330");
shouldBe("elm07.offsetWidth", "50");
shouldBe("elm08.offsetWidth", "630");
// non-auto column-count and large column-width
shouldBe("elm09.offsetWidth", "100");
shouldBe("elm10.offsetWidth", "480");
shouldBe("elm11.offsetWidth", "100");
shouldBe("elm12.offsetWidth", "630");
// auto column-count and small column-width
shouldBe("elm13.offsetWidth", "50");
shouldBe("elm14.offsetWidth", "100");
shouldBe("elm15.offsetWidth", "50");
shouldBe("elm16.offsetWidth", "200");
// auto column-count and large column-width
shouldBe("elm17.offsetWidth", "100");
shouldBe("elm18.offsetWidth", "150");
shouldBe("elm19.offsetWidth", "100");
shouldBe("elm20.offsetWidth", "200");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>