<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body id="body">
<div id="content">
<div role="button" id="button1">
<a href="#">foo1</a>
</div>
<button id="button2">
<a href="#">foo2</a>
</button>
</div>
<div id="console"></div>
<script>
test((t) => {
var button1 = accessibilityController.accessibleElementById("button1");
assert_equals(button1.name, 'foo1');
var button2 = accessibilityController.accessibleElementById("button2");
assert_equals(button2.name, 'foo2');
document.getElementById("content").style.visibility = 'hidden';
}, "This tests that when a link is inside a button, its visible text is still available for the button.");
</script>
</body>
</html>