Move platform/mac/accessibility tests to accessibility/mac.
[WebKit-https.git] / LayoutTests / accessibility / mac / attributed-string-includes-misspelled-with-selection.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <script>
6 if (window.testRunner)
7    testRunner.dumpAsText();
8 </script>
9 </head>
10 <body>
11
12 <div contenteditable=true id="content" role="textbox">
13
14 word mispelled word
15
16 </div>
17
18
19 <p id="description"></p>
20 <div id="console"></div>
21
22 <script>
23
24     description("This tests that if the cursor is on a misspelled word, the misspelled marker will still be returned for that range. The test places selection in the middle of 'mispelled' and then queries for the attributed string.");
25
26     if (window.accessibilityController) {
27         var content = document.getElementById("content");
28         content.focus();
29
30         var s = window.getSelection();
31         s.setPosition(content, 0);
32         for (var k = 0; k < 10; k++) {
33             s.modify("move", "forward", "character");   
34         }
35
36         var text = accessibilityController.focusedElement;
37         var attrString = text.attributedStringForRange(0, document.getElementById("content").innerText.length);
38
39         shouldBeTrue("attrString.indexOf('AXMisspelled = 1') != -1");
40     }
41
42 </script>
43
44 <script src="../../resources/js-test-post.js"></script>
45
46 </body>
47 </html>
48