blob: 417cb8ad20a3db76f7f8eeced788621fe21cc222 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
#flexbox {
display: -webkit-flex;
}
#left {
-webkit-flex: 1;
background-color: yellow;
}
#content {
-webkit-flex: 1;
background-color: grey;
}
</style>
<script>
// This test makes sure that we repaint the right region of a flexbox when
// changing the flex values. Only the middle of the test page should be
// repainted. If the top of the test page (above the flexbox) is repainted,
// this test fails.
function setFlex(id, animationPercentage, start, end) {
var flexValue = start + ((end - start) * animationPercentage);
document.getElementById(id).style.webkitFlex = flexValue + " 0 0px";
}
function step(count) {
var animationPercentage = count ? 1 : .9;
setFlex("content", animationPercentage, 1, 5);
if (!count)
setTimeout(step.bind(null, 1));
else {
if (window.testRunner)
testRunner.notifyDone();
}
}
window.onload = function() {
if (window.testRunner) {
testRunner.dumpAsText(true);
document.body.offsetTop;
testRunner.displayAndTrackRepaints();
testRunner.waitUntilDone();
}
window.startTime = Date.now();
setTimeout(step.bind(null, 0), 0);
};
</script>
</head>
<body>
<br><br><br><br><br><br>
<div id="flexbox">
<div id="left"></div>
<div id="content">
<p style="margin: 0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet. Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula. Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.</p>
</div>
</body>
</html>