Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / content-editable-set-inner-text-generates-axvalue-notification.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <div id="content" contenteditable tabindex="0">
9 hello<br>
10 <b>world</b>
11 </div>
12
13 <p id="description"></p>
14 <div id="console"></div>
15
16 <script>
17
18     description("This tests that a contenteditable region will send an AXValueChange notification when JS methods for changing children are used.");
19
20     var notification = 0;
21     var textArea = 0;
22     var valueChangeCount = 0;
23     function callback(notification) {
24         if (notification == "AXValueChanged") {
25             debug("Updated value: " + textArea.stringValue);
26             valueChangeCount++;
27
28             if (valueChangeCount == 1) {
29                 document.getElementById("content").innerHTML = "Test2";
30             }
31             else if (valueChangeCount == 2) {
32                 document.getElementById("content").innerText = "Test3";
33             }
34             else if (valueChangeCount == 3) {
35                 document.getElementById("content").appendChild(document.createTextNode("Test4"));
36             }
37             else if (valueChangeCount == 4) {
38                 document.getElementById("content").style.visibility = "hidden";
39                 textArea.removeNotificationListener();
40                 finishJSTest();
41             }
42         }
43     }
44
45     if (window.accessibilityController) {
46         window.jsTestIsAsync = true;
47
48         textArea = accessibilityController.accessibleElementById("content");
49         textArea.addNotificationListener(callback);
50
51         // Send value changes.
52         document.getElementById("content").innerText = "Test1";
53     }
54
55 </script>
56
57 <script src="../resources/js-test-post.js"></script>
58 </body>
59 </html>