blob: 2a6a8c2f6d2baf699f93f01306422b52fbbcf710 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test.js"></script>
<script src="../../resources/accessibility-helper.js"></script>
<custom-heading id="heading-1">1. Some title</custom-heading>
<custom-heading id="heading-1-1" aria-level="2">1.1. Subtitle</custom-heading>
<script>
customElements.define('custom-heading', class CustomElement extends HTMLElement {
constructor()
{
super();
const internals = this.attachInternals();
internals.role = 'heading';
internals.ariaLevel = '1';
}
});
description("This tests that aria fallback roles work correctly.");
if (!window.accessibilityController)
debug('This test requires accessibilityController');
else {
shouldBe('accessibilityController.accessibleElementById("heading-1").intValue', '1');
shouldBe('accessibilityController.accessibleElementById("heading-1-1").intValue', '2');
}
</script>
</body>
</html>