blob: 46379cb94da1231834399e93aeb55e9dcc3f81b4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function() {
// fetch offsetTop to force a layout
document.body.offsetTop;
var el = document.querySelector('#add-shape-outside .shape');
el.className = 'shape rectangle50';
el = document.querySelector('#change-shape-outside .shape');
el.className = 'shape rectangle25';
el = document.querySelector('#remove-shape-outside .shape');
el.className = 'shape';
}
</script>
<style>
.container {
width: 200px;
height: 200px;
overflow-wrap: break-word;
border: 2px solid blue;
font: 50px/1 Ahem, sans-serif;
color: green;
overflow: hidden;
}
.shape-wrapper {
width: 0;
height: 0;
}
.shape {
float: left;
position: relative;
width: 100px;
height: 100px;
}
.shape::before {
position: absolute;
display: block;
top: 0px; left: 0px;
width: 100%;
height: 100%;
background-color: blue;
content: ' ';
}
.rectangle50 {
-webkit-shape-outside: polygon(0px 0px, 50px 0px, 50px 50px, 0px 50px);
}
.rectangle50::before {
width: 50px;
height: 50px;
}
.rectangle25 {
-webkit-shape-outside: polygon(0px 0px, 25px 0px, 25px 25px, 0px 25px);
}
.rectangle25::before {
width: 25px;
height: 25px;
}
</style>
</head>
<body>
<p>When shape-outside is modified dynamically, content affected by the shape's contour should relayout. This test is for shape-outside floats that overhang their parent container. For each test, you should see green blocks separated by white space, wrapping around a blue square in the upper left. This test requires the Ahem font.</p>
<p>Setting shape-outside with no prior entry</p>
<div id='add-shape-outside' class='container'><div class='shape-wrapper'><div class='shape'></div></div>x x x x x x x x x x</div>
<p>Setting shape-outside with a prior entry</p>
<div id='change-shape-outside' class='container'><div class='shape-wrapper'><div class='shape rectangle50'></div></div>x x x x x x x x x x</div>
<p>Removing shape-outside with a prior entry</p>
<div id='remove-shape-outside' class='container'><div class='shape-wrapper'><div class='shape rectangle50'></div></div>x x x x x x x x x x</div>
</body>
</html>