2009-11-12 Joanmarie Diggs <joanmarie.diggs@gmail.com>
[WebKit-https.git] / LayoutTests / accessibility / document-attributes.html
1 <html>
2 <script>
3     if (window.layoutTestController)
4         layoutTestController.dumpAsText();
5 </script>
6 <head>
7 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8 <body id="body">
9     <!-- This tests the exposure of a document's encoding and URI to assistive technologies -->
10     <div id="result"></div>
11     <script>
12         if (window.accessibilityController) {
13             var body = document.getElementById("body");
14             body.focus();
15             var webArea = accessibilityController.focusedElement;
16             var result = document.getElementById("result");
17
18             var documentEncoding = webArea.documentEncoding;
19             var documentURI = webArea.documentURI;
20
21             if (documentEncoding == "UTF-8" && documentURI == location.href) {
22                result.innerText = "Passed";
23             }
24             else {
25                result.innerText = "Failed:\nExpected: UTF-8 and " + location.href + ".\nActual: " + documentEncoding + " and " + documentURI + ".";
26             }
27         }
28     </script>
29 </body>
30 </html>