blob: 9543b1c2754f3a51f9987693c4f617b799d4bfad [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test shorthand transitions</title>
<style type="text/css" media="screen">
#box {
height: 100px;
width: 100px;
margin: 10px;
background-color: gray;
border: 0px solid rgb(0, 0, 0);
-webkit-transition: border 1s linear;
}
#box.final {
border: 20px dashed rgb(255, 0, 255);
}
#box1 {
height: 100px;
width: 100px;
margin: 10px;
background-color: gray;
border: 0px solid rgb(0, 0, 0);
-webkit-transition: border-width 1s linear;
}
#box1.final {
border: 20px solid rgb(255, 0, 255);
}
#box2 {
height: 100px;
width: 100px;
margin: 10px;
background-color: gray;
border: 0px solid rgb(0, 0, 0);
-webkit-transition: border 1s linear;
}
#box2.final {
border-width: 20px;
border-bottom-width: 40px;
}
</style>
<script src="transition-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
// color and width of each side should be animating
[0.5, 'box', 'border-top-color', [128, 0, 128], 10],
[0.5, 'box', 'border-right-color', [128, 0, 128], 10],
[0.5, 'box', 'border-bottom-color', [128, 0, 128], 10],
[0.5, 'box', 'border-left-color', [128, 0, 128], 10],
[0.5, 'box', 'border-top-width', 10, 1],
[0.5, 'box', 'border-right-width', 10, 1],
[0.5, 'box', 'border-bottom-width', 10, 1],
[0.5, 'box', 'border-left-width', 10, 1],
// only border-width should be animating
[0.5, 'box1', 'border-top-width', 10, 1],
[0.5, 'box1', 'border-top-color', [255, 0, 255], 0], // initial value
// border-width should be animating
[0.5, 'box2', 'border-top-width', 10, 1],
[0.5, 'box2', 'border-bottom-width', 20, 1],
];
function setupTest()
{
var box = document.getElementById('box');
box.className = 'final';
var box1 = document.getElementById('box1');
box1.className = 'final';
var box2 = document.getElementById('box2');
box2.className = 'final';
}
runTransitionTest(expectedValues, setupTest, false);
</script>
</head>
<body>
<p>
Tests transitions of the border shorthand properties.
</p>
<div id="box"></div>
<div id="box1"></div>
<div id="box2"></div>
<div id="result">
</div>
</body>
</html>