Skip to content

Commit

Permalink
bypass bogus AOM crashtests that assume abaondoned API will be added. (
Browse files Browse the repository at this point in the history
  • Loading branch information
cookiecrook authored and Lightning00Blade committed Dec 11, 2023
1 parent e8144dc commit ce8111b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 18 deletions.
10 changes: 9 additions & 1 deletion accessibility/crashtests/aom-in-destroyed-iframe.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<html class="test-wait">
<body></body>
<script>

// Bypass this abandoned syntax in all but the engines that implement it.
if (typeof getComputedAccessibleNode !== 'undefined') {

const frameElem = document.createElement('iframe');

frameElem.srcdoc = '<html><head><title>X</title></head><body><div>-</div></body></html>';
Expand All @@ -21,7 +25,11 @@
});
});
};

document.body.appendChild(frameElem);

} else {
// Pass in other engines that have not implemented the abandoned API
document.documentElement.className = '';
}
</script>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,27 @@
<h1>Heading</h1>

<script>
async function trigger1() {
let heading = document.querySelector('h1');
let computed_accessible_node = await self.getComputedAccessibleNode(heading);
let first_child = computed_accessible_node.firstChild;
// The first child of the heading is a pseudo element <table>.
await first_child.ensureUpToDate();
// The next child down has an accessibility object but no node.
let grand_child = first_child.firstChild;
await grand_child.ensureUpToDate();

// Bypass this abandoned syntax in all but the engines that implement it.
if (typeof getComputedAccessibleNode !== 'undefined') {

async function trigger1() {
let heading = document.querySelector('h1');
let computed_accessible_node = await self.getComputedAccessibleNode(heading);
let first_child = computed_accessible_node.firstChild;
// The first child of the heading is a pseudo element <table>.
await first_child.ensureUpToDate();
// The next child down has an accessibility object but no node.
let grand_child = first_child.firstChild;
await grand_child.ensureUpToDate();
document.documentElement.className = '';
}
trigger1();

} else {
// Pass in other engines that have not implemented the abandoned API
document.documentElement.className = '';
}
trigger1();

</script>
</html>
24 changes: 17 additions & 7 deletions accessibility/crashtests/computed-accessible-text-node.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
<html class="test-wait">
<img id="img1">text
<script>
async function trigger1() {
let img = document.getElementById('img1');
let computed_accessible_node = await self.getComputedAccessibleNode(img);
// The next sibling is a text node.
let next_sibling = computed_accessible_node.nextSibling;
await next_sibling.ensureUpToDate();

// Bypass this abandoned syntax in all but the engines that implement it.
if (typeof getComputedAccessibleNode !== 'undefined') {

async function trigger1() {
let img = document.getElementById('img1');
let computed_accessible_node = await self.getComputedAccessibleNode(img);
// The next sibling is a text node.
let next_sibling = computed_accessible_node.nextSibling;
await next_sibling.ensureUpToDate();
document.documentElement.className = '';
}
trigger1();

} else {
// Pass in other engines that have not implemented the abandoned API
document.documentElement.className = '';
}
trigger1();

</script>
</html>
11 changes: 11 additions & 0 deletions accessibility/crashtests/computed-node-checked.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</script>
<script>step_timeout(gc, 50);</script>
<script>

// Bypass this abandoned syntax in all but the engines that implement it.
if (typeof getComputedAccessibleNode !== 'undefined') {

const frameElem = document.createElement('iframe');

frameElem.srcdoc = '<div></div>';
Expand All @@ -34,5 +38,12 @@
});
};
document.body.appendChild(frameElem);

} else {
// Pass in other engines that have not implemented the abandoned API
document.documentElement.className = '';
}


</script>
</html>

0 comments on commit ce8111b

Please sign in to comment.