Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / press-target-uses-text-descendant-node.html
1 <html>
2 <head>
3 <script src="../resources/js-test-pre.js"></script>
4 <script type="text/javascript">
5     function handleClick(e) {
6         if (e.target.classList.contains("target")) {
7             debug("Clicked on element: " + e.target.nodeName);
8         }
9         return false;
10     }
11 </script>
12 <style type="text/css">
13     a:link, button {
14         padding: 10px;
15         margin: 10px;
16         background-color: red;
17         display: inline-block;
18     }
19     .target {
20         background-color: yellow;
21     }
22 </style>
23 </head>
24 <body>
25
26 <a href="#" onclick="return handleClick(event);" id="link">
27     <span class="target">click only works on span inside link, not red link edges</span>
28 </a>
29
30 <button onclick="return handleClick(event);" id="button">
31     <img src="resources/cake.png" alt="click only works on image inside button, not red button edges" class="target" onload="startTest();">
32 </button>
33
34 <p id="description"></p>
35 <div id="console"></div>
36
37 <script>
38
39     description("Make sure that when performing a press, we target the deepest descendant, but also one that is an Element at the least.");
40
41     document.getElementById("link").addEventListener("click", pressedLink);
42     document.getElementById("button").addEventListener("click", pressedButton);
43     function startTest() {
44        accessibilityController.accessibleElementById("link").press();
45     }
46
47     if (window.accessibilityController) {
48        window.jsTestIsAsync = true;
49     }
50     
51     function pressedLink() {
52         debug("\nNow pressing on button\n");
53         accessibilityController.accessibleElementById("button").press();
54     }
55     
56     function pressedButton() {
57         finishJSTest();
58     }
59
60 </script>
61
62 <script src="../resources/js-test-post.js"></script>
63 </body>
64 </html>