4 background-color: green;
6 -webkit-transition: all
1s linear;
7 -moz-transition: all
1s linear;
10 #startCalcEndCalc, #startCalcEndPx, #startCalcEndPercent {
11 width: calc(
10% +
50px);
12 width: -moz-calc(
10% +
50px);
19 #startPercentEndCalc {
23 #startCalcEndCalc.go, #startPxEndCalc.go, #startPercentEndCalc.go {
24 width: calc(
100% -
100px);
25 width: -moz-calc(
100% -
100px);
32 #startCalcEndPercent.go {
37 This tests that transitions containing calc() expressions transition correctly.
38 <div style=
"width:500px; border: 1px solid black;">
39 <div class=
"transitionTest" id=
"startCalcEndCalc"></div>
40 <div class=
"transitionTest" id=
"startPxEndCalc"></div>
41 <div class=
"transitionTest" id=
"startPercentEndCalc"></div>
42 <div class=
"transitionTest" id=
"startCalcEndPx"></div>
43 <div class=
"transitionTest" id=
"startCalcEndPercent"></div>
45 <div id=
"result"></div>
47 <script src=
"../../animations/resources/animation-test-helpers.js"></script>
50 const tests
= ["startCalcEndCalc", "startPxEndCalc", "startPercentEndCalc", "startCalcEndPx", "startCalcEndPercent"];
54 for (var i
= 0; i
< tests
.length
; i
++) {
55 expectedValues
= expectedValues
.concat([[0.25, tests
[i
], 'width', 175, 2]]);
56 expectedValues
= expectedValues
.concat([[0.5, tests
[i
], 'width', 250, 2]]);
57 expectedValues
= expectedValues
.concat([[0.75, tests
[i
], 'width', 325, 2]]);
58 expectedValues
= expectedValues
.concat([[1.0, tests
[i
], 'width', 400, 2]]);
61 function initialize(id
)
63 var expectedStartWidth
= 100;
64 var element
= document
.getElementById(id
);
65 var width
= element
.offsetWidth
;
66 if (width
== expectedStartWidth
)
67 result
+= 'PASS - "width" property for "' + id
+'" element at 0.0s was: ' + width
+ '<br>';
69 result
+= 'FAIL - "width" property for "' + id
+'" element at 0.0s expected: ' + expectedStartWidth
+ ' but saw: ' + width
+ '<br>';
71 element
.className
+= " go";
76 for (var i
= 0; i
< tests
.length
; i
++)
80 runTransitionTest(expectedValues
, setupTest
, undefined, false /* pixel test */);