blob: 198c5aff8c42e228715dcdd7f8820e298666acae [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
<html>
<head>
<style>
#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="resources/transition-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance, callback, should-be-transitioning]
// color and width of each side should be animating
[0.5, 'box', 'border-top-color', [128, 0, 128], 30],
[0.5, 'box', 'border-right-color', [128, 0, 128], 30],
[0.5, 'box', 'border-bottom-color', [128, 0, 128], 30],
[0.5, 'box', 'border-left-color', [128, 0, 128], 30],
[0.5, 'box', 'border-top-width', 10, 2],
[0.5, 'box', 'border-right-width', 10, 2],
[0.5, 'box', 'border-bottom-width', 10, 2],
[0.5, 'box', 'border-left-width', 10, 2],
// only border-width should be animating
[0.5, 'box1', 'border-top-width', 10, 2],
[0.5, 'box1', 'border-top-color', [255, 0, 255], 0, null, shouldNotBeTransitioning],
// border-width should be animating
[0.5, 'box2', 'border-top-width', 10, 2],
[0.5, 'box2', 'border-bottom-width', 20, 4],
];
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, usePauseAPI);
</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>