forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinherit.html
More file actions
76 lines (67 loc) · 1.8 KB
/
inherit.html
File metadata and controls
76 lines (67 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<html>
<head>
<style>
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
}
.transition {
-webkit-transition-property: left;
-webkit-transition-duration: 2s;
}
#box4 {
-webkit-transition-property: inherit;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var kExpecteds = [
'all', /* box1 */
'left', /* box2 */
'left', /* box3 */
'left', /* box4 */ /* inherits from box3 */
'left', /* box5 */
'all', /* box6 */ /* does NOT inherit */
];
function testProperties()
{
var result = '';
var boxes = document.body.getElementsByClassName('box');
for (var i = 0; i < boxes.length; ++i) {
var curBox = boxes[i];
var curProp = window.getComputedStyle(curBox).webkitTransitionProperty;
if (curProp == kExpecteds[i])
result += "PASS -- ";
else
result += "FAIL -- ";
result += "Box " + (i+1) + " computed transition property: " + curProp + " expected: " + kExpecteds[i] + "<br>";
}
document.body.removeChild(document.getElementById('container'));
document.getElementById('result').innerHTML = result;
if (window.testRunner)
testRunner.notifyDone();
}
window.addEventListener('load', testProperties, false);
</script>
</head>
<body>
<div id="container">
<div id="box1" class="box"></div>
<div id="box2" class="box transition"></div>
<div id="box3" class="box transition">
<div id="box4" class="box"></div>
</div>
<div id="box5" class="box transition">
<div id="box6" class="box"></div>
</div>
</div>
<div id="result"></div>
</body>
</html>