Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bypass bogus AOM crashtests that assume abandoned syntax will be added. #41576

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Copy link
Contributor Author

@cookiecrook cookiecrook Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers... The tests pass by removing this "test-wait" classname.

The diffs below wrap a conditional if/else around blocks that only work in Chrome, because it relies on an abandoned API proposal (getComputedAccessibleNode). The larger diff blocks are the same, but indented so every line is different.

This allows WPT to keep the crashtest running for Chrome without penalizing other engines with 4 bogus failures.

<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>