|
1 <html> |
|
2 <head> |
|
3 <title>states of document article</title> |
|
4 |
|
5 <link rel="stylesheet" type="text/css" |
|
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 |
|
11 <script type="application/javascript" |
|
12 src="../common.js"></script> |
|
13 <script type="application/javascript" |
|
14 src="../role.js"></script> |
|
15 <script type="application/javascript" |
|
16 src="../states.js"></script> |
|
17 |
|
18 <script type="application/javascript"> |
|
19 function doTest() |
|
20 { |
|
21 var docAcc = getAccessible(document, [nsIAccessibleDocument]); |
|
22 if (docAcc) { |
|
23 testStates(docAcc, STATE_READONLY); |
|
24 testStates("aria_article", STATE_READONLY); |
|
25 testStates("editable_aria_article", 0, EXT_STATE_EDITABLE, |
|
26 STATE_READONLY); |
|
27 testStates("article", STATE_READONLY); |
|
28 testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
29 |
|
30 document.designMode = "on"; |
|
31 |
|
32 testStates(docAcc, 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
33 testStates("aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
34 testStates("editable_aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
35 testStates("article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
36 testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
37 |
|
38 document.designMode = "off"; |
|
39 |
|
40 testStates(docAcc, STATE_READONLY); |
|
41 testStates("aria_article", STATE_READONLY); |
|
42 testStates("editable_aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
43 testStates("article", STATE_READONLY); |
|
44 testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY); |
|
45 } |
|
46 SimpleTest.finish(); |
|
47 } |
|
48 |
|
49 SimpleTest.waitForExplicitFinish(); |
|
50 addA11yLoadEvent(doTest); |
|
51 </script> |
|
52 </head> |
|
53 |
|
54 <body role="article"> |
|
55 |
|
56 <a target="_blank" |
|
57 href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387" |
|
58 title="Expose non-editable documents as readonly, regardless of role"> |
|
59 Mozilla Bug 467387 |
|
60 </a><br/> |
|
61 <a target="_blank" |
|
62 href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502" |
|
63 title="Map <article> like we do aria role article"> |
|
64 Mozilla Bug 613502 |
|
65 </a> |
|
66 <p id="display"></p> |
|
67 <div id="content" style="display: none"></div> |
|
68 <pre id="test"> |
|
69 </pre> |
|
70 |
|
71 <div id="aria_article" role="article">aria article</div> |
|
72 <div id="editable_aria_article" role="article" contentEditable="true"> |
|
73 editable aria article</div> |
|
74 |
|
75 <article id="article">article</article> |
|
76 <article id="editable_article" contentEditable="true"> |
|
77 editable article</article> |
|
78 |
|
79 </body> |
|
80 </html> |