Revision control

1
<!DOCTYPE html><!-- webkit-test-runner [ CSSTypedOMEnabled=true ] -->
2
<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org">
3
<meta name="assert" content="Test that the [SameObject] idl attribute is respected">
4
<script src="../resources/js-test-pre.js"></script>
5
6
<div id="el" style = "width: 150px; height: 10em; --my-prop: hello;"></div>
7
8
<script>
9
description("Tests that idl [SameObject] is specified.");
10
window.jsTestIsAsync = true;
11
12
function promiseChain(body, times) {
13
let i = 0;
14
return new Promise(function(resolve, reject) {
15
handle = setInterval(function() {
16
if (i >= times) {
17
clearInterval(handle);
18
resolve();
19
return;
20
}
21
22
body();
23
24
++i;
25
}, 10);
26
});
27
}
28
29
function makeAlive() {
30
el.attributeStyleMap.alive = true;
31
}
32
33
function isAlive() {
34
return !!el.attributeStyleMap.alive;
35
}
36
37
function testAlive() {
38
if (isAlive()) {
39
testPassed("element is still alive");
40
} else {
41
testFailed("element is not alive");
42
}
43
}
44
45
window.onload = function() {
46
setTimeout(function() {
47
makeAlive();
48
testAlive()
49
50
promiseChain(function() {
51
gc();
52
testAlive();
53
}, 10).then(function () {
54
finishJSTest();
55
});
56
}, 10);
57
}
58
</script>
59
<script src="../resources/js-test-post.js"></script>