blob: 0111e40408375f6a1b6b6e338f0a320b2da3b1f5 [file] [log] [blame] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body>
<div id="content">
<div id="div" role="group">
</div>
<a href="https://apple.com" id="link">apple.com</a>
</div>
<script>
var output = "This test ensures that an AX element's position is updated after a dynamic page change.\n\n";
var link, startY, endY;
if (window.accessibilityController) {
window.jsTestIsAsync = true;
setTimeout(async function() {
await waitForFrameGeometryReady();
link = accessibilityController.accessibleElementById("link");
startY = link.y;
endY;
document.getElementById("div").innerHTML = `
foo bar foo bar foo bar foo bar
<br>
foo bar foo bar foo bar foo bar
<br>
foo bar foo bar foo bar foo bar
<br>
foo bar foo bar foo bar foo bar
<br>
foo bar foo bar foo bar foo bar
`;
await waitFor(() => {
endY = link.y;
return startY !== endY;
});
output += `PASS: Link moved ${Math.abs(startY - endY)}px in response to dynamic page change.`;
document.getElementById("content").style.visibility = "hidden";
debug(output);
finishJSTest();
}, 0);
}
</script>
</body>
</html>