Skip to content

Commit b685181

Browse files
authored
bypass bogus AOM crashtests that assume abaondoned API will be added. (#41576)
Closes web-platform-tests/interop-accessibility#56
1 parent bea5b03 commit b685181

4 files changed

+57
-18
lines changed

accessibility/crashtests/aom-in-destroyed-iframe.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<html class="test-wait">
22
<body></body>
33
<script>
4+
5+
// Bypass this abandoned syntax in all but the engines that implement it.
6+
if (typeof getComputedAccessibleNode !== 'undefined') {
7+
48
const frameElem = document.createElement('iframe');
59

610
frameElem.srcdoc = '<html><head><title>X</title></head><body><div>-</div></body></html>';
@@ -21,7 +25,11 @@
2125
});
2226
});
2327
};
24-
2528
document.body.appendChild(frameElem);
29+
30+
} else {
31+
// Pass in other engines that have not implemented the abandoned API
32+
document.documentElement.className = '';
33+
}
2634
</script>
2735
</html>

accessibility/crashtests/computed-accessible-child-of-pseudo-element.html

+20-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@
66
<h1>Heading</h1>
77

88
<script>
9-
async function trigger1() {
10-
let heading = document.querySelector('h1');
11-
let computed_accessible_node = await self.getComputedAccessibleNode(heading);
12-
let first_child = computed_accessible_node.firstChild;
13-
// The first child of the heading is a pseudo element <table>.
14-
await first_child.ensureUpToDate();
15-
// The next child down has an accessibility object but no node.
16-
let grand_child = first_child.firstChild;
17-
await grand_child.ensureUpToDate();
9+
10+
// Bypass this abandoned syntax in all but the engines that implement it.
11+
if (typeof getComputedAccessibleNode !== 'undefined') {
12+
13+
async function trigger1() {
14+
let heading = document.querySelector('h1');
15+
let computed_accessible_node = await self.getComputedAccessibleNode(heading);
16+
let first_child = computed_accessible_node.firstChild;
17+
// The first child of the heading is a pseudo element <table>.
18+
await first_child.ensureUpToDate();
19+
// The next child down has an accessibility object but no node.
20+
let grand_child = first_child.firstChild;
21+
await grand_child.ensureUpToDate();
22+
document.documentElement.className = '';
23+
}
24+
trigger1();
25+
26+
} else {
27+
// Pass in other engines that have not implemented the abandoned API
1828
document.documentElement.className = '';
1929
}
20-
trigger1();
30+
2131
</script>
2232
</html>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
<html class="test-wait">
22
<img id="img1">text
33
<script>
4-
async function trigger1() {
5-
let img = document.getElementById('img1');
6-
let computed_accessible_node = await self.getComputedAccessibleNode(img);
7-
// The next sibling is a text node.
8-
let next_sibling = computed_accessible_node.nextSibling;
9-
await next_sibling.ensureUpToDate();
4+
5+
// Bypass this abandoned syntax in all but the engines that implement it.
6+
if (typeof getComputedAccessibleNode !== 'undefined') {
7+
8+
async function trigger1() {
9+
let img = document.getElementById('img1');
10+
let computed_accessible_node = await self.getComputedAccessibleNode(img);
11+
// The next sibling is a text node.
12+
let next_sibling = computed_accessible_node.nextSibling;
13+
await next_sibling.ensureUpToDate();
14+
document.documentElement.className = '';
15+
}
16+
trigger1();
17+
18+
} else {
19+
// Pass in other engines that have not implemented the abandoned API
1020
document.documentElement.className = '';
1121
}
12-
trigger1();
22+
1323
</script>
1424
</html>

accessibility/crashtests/computed-node-checked.html

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
</script>
2020
<script>step_timeout(gc, 50);</script>
2121
<script>
22+
23+
// Bypass this abandoned syntax in all but the engines that implement it.
24+
if (typeof getComputedAccessibleNode !== 'undefined') {
25+
2226
const frameElem = document.createElement('iframe');
2327

2428
frameElem.srcdoc = '<div></div>';
@@ -34,5 +38,12 @@
3438
});
3539
};
3640
document.body.appendChild(frameElem);
41+
42+
} else {
43+
// Pass in other engines that have not implemented the abandoned API
44+
document.documentElement.className = '';
45+
}
46+
47+
3748
</script>
3849
</html>

0 commit comments

Comments
 (0)