summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/accessibility/aria-text-role.html
blob: 12c62be054f29735e62d2bc1136fe0857f30fdd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">

<div id="textrole" tabindex=0 role="text" aria-label="all at once">
<b>hello world</b>
<i>this is a test</i>
<a href="#">more test</a>
</div>

<p id="description"></p>
<div id="console"></div>

<script>

    description("This tests that you can set an ARIA text role and that it will not have children through hit testing");

    if (window.accessibilityController) {

        document.getElementById("textrole").focus();
        var textrole = accessibilityController.focusedElement;
        shouldBe("textrole.role", "'AXRole: AXStaticText'");
        shouldBe("textrole.stringValue", "'AXValue: all at once'");

        // now check the hit-testing
        var x = textrole.clickPointX;
        var y = textrole.clickPointY;
        shouldBe("textrole.elementAtPoint(x, y).isEqual(textrole)", "true");
    }

</script>

</body>
</html>