blob: e1de3ca8fdb13212158b1c06e6d4bae452434456 [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: white;
outline-color: black;
-webkit-transition-property: padding, margin, outline, background, -webkit-border-radius, -webkit-transform-origin;
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: linear;
-webkit-transform-origin: bottom left;
}
#box.final {
padding: 10px;
margin: 40px;
outline: 10px solid rgb(255, 0, 255);
background-color: blue;
-webkit-border-radius: 20px;
-webkit-transform-origin: top right;
}
</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]
[0.5, 'box', 'padding-top', 5, 1],
[0.5, 'box', 'margin-top', 25, 2],
[0.5, 'box', 'outline-color', [128, 0, 128], 10],
[0.5, 'box', 'background-color', [128, 128, 255], 10],
[0.5, 'box', '-webkit-border-top-right-radius', 10, 2],
[0.5, 'box', '-webkit-transform-origin', [50, 50], 5],
];
function setupTest()
{
var box = document.getElementById('box');
box.className = 'final';
}
// We can't use the pause API because it only works for individual properties, and
// -webkit-transform-origin is a compound property.
runTransitionTest(expectedValues, setupTest, false);
</script>
</head>
<body>
<p>
Tests transitions of the shorthand properties padding, margin, outline, background, -webkit-border-radius.
</p>
<div id="box"></div>
<div id="result">
</div>
</body>
</html>