1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Test shorthand transitions
</title>
8 <style type=
"text/css" media=
"screen">
13 background-color: white;
15 -webkit-transition-property: padding, margin, outline, background, -webkit-border-radius, -webkit-transform-origin;
16 -webkit-transition-duration:
1s;
17 -webkit-transition-timing-function: linear;
18 -webkit-transform-origin: bottom left;
24 outline:
10px solid rgb(
255,
0,
255);
25 background-color: blue;
26 -webkit-border-radius:
20px;
27 -webkit-transform-origin: top right;
31 <script src=
"transition-test-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
32 <script type=
"text/javascript" charset=
"utf-8">
34 const expectedValues = [
35 // [time, element-id, property, expected-value, tolerance]
36 // The transition takes
1 second, so we compute tolerance to allow
37 //
10% or
100ms variance, (endValue - startValue) /
10.
38 [
0.5, 'box', 'padding-top',
5,
1],
39 [
0.5, 'box', 'margin-top',
25,
3],
40 [
0.5, 'box', 'outline-color', [
128,
0,
128],
26],
41 [
0.5, 'box', 'background-color', [
128,
128,
255],
26],
42 [
0.5, 'box', '-webkit-border-top-right-radius',
10,
2],
43 [
0.5, 'box', '-webkit-transform-origin', [
50,
50],
10],
48 var box = document.getElementById('box');
49 box.className = 'final';
52 // We can't use the pause API because it only works for individual properties, and
53 // -webkit-transform-origin is a compound property.
54 runTransitionTest(expectedValues, setupTest, false);
60 Tests transitions of the shorthand properties padding, margin, outline, background, -webkit-border-radius.