Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>frame based document testing</title> |
michael@0 | 5 | |
michael@0 | 6 | <link rel="stylesheet" type="text/css" |
michael@0 | 7 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../role.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../states.js"></script> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | if (navigator.platform.startsWith("Win")) { |
michael@0 | 21 | SimpleTest.expectAssertions(0, 2); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function doTest() |
michael@0 | 25 | { |
michael@0 | 26 | frameDoc = document.getElementById("frame_doc").contentDocument; |
michael@0 | 27 | frameDocArticle = document.getElementById("frame_doc_article").contentDocument; |
michael@0 | 28 | frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument; |
michael@0 | 29 | frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument; |
michael@0 | 30 | |
michael@0 | 31 | testStates(frameDoc, STATE_READONLY, 0, 0, 0, |
michael@0 | 32 | "test1: frameDoc"); |
michael@0 | 33 | testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, |
michael@0 | 34 | "test1: frameDocArticle"); |
michael@0 | 35 | testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, |
michael@0 | 36 | "test1: frameDocCheckbox"); |
michael@0 | 37 | testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, |
michael@0 | 38 | "test1: frameDocTextbox"); |
michael@0 | 39 | frameDoc.designMode = "on"; |
michael@0 | 40 | testStates(frameDoc, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, |
michael@0 | 41 | "test2: frameDoc"); |
michael@0 | 42 | testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, |
michael@0 | 43 | "test2: frameDocArticle"); |
michael@0 | 44 | testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, |
michael@0 | 45 | "test2: frameDocCheckbox"); |
michael@0 | 46 | testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, |
michael@0 | 47 | "test2: frameDocTextbox"); |
michael@0 | 48 | |
michael@0 | 49 | frameDocArticle.designMode = "on"; |
michael@0 | 50 | testStates(frameDocArticle, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, |
michael@0 | 51 | "test3: frameDocArticle"); |
michael@0 | 52 | |
michael@0 | 53 | frameDocCheckbox.designMode = "on"; |
michael@0 | 54 | testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, |
michael@0 | 55 | "test4: frameDocCheckbox"); |
michael@0 | 56 | |
michael@0 | 57 | // Replace iframe document body before the document accessible tree is |
michael@0 | 58 | // created. Check the states are updated for new body. |
michael@0 | 59 | var frameUpdateDoc = |
michael@0 | 60 | document.getElementById("frame_updatedoc").contentDocument; |
michael@0 | 61 | testStates(frameUpdateDoc, 0, EXT_STATE_EDITABLE, |
michael@0 | 62 | STATE_READONLY, EXT_STATE_STALE, "test5: frameUpdateDoc"); |
michael@0 | 63 | |
michael@0 | 64 | SimpleTest.finish(); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 68 | addA11yLoadEvent(doTest); |
michael@0 | 69 | </script> |
michael@0 | 70 | </head> |
michael@0 | 71 | |
michael@0 | 72 | <body> |
michael@0 | 73 | |
michael@0 | 74 | <a target="_blank" |
michael@0 | 75 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387" |
michael@0 | 76 | title="Expose non-editable documents as readonly, regardless of role"> |
michael@0 | 77 | Mozilla Bug 467387 |
michael@0 | 78 | </a> |
michael@0 | 79 | <a target="_blank" |
michael@0 | 80 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=638106" |
michael@0 | 81 | title="CKEditor document should be editable"> |
michael@0 | 82 | Mozilla Bug 638106 |
michael@0 | 83 | </a> |
michael@0 | 84 | <p id="display"></p> |
michael@0 | 85 | <div id="content" style="display: none"></div> |
michael@0 | 86 | <pre id="test"> |
michael@0 | 87 | </pre> |
michael@0 | 88 | |
michael@0 | 89 | <iframe id="frame_doc" src="z_frames.html"></iframe> |
michael@0 | 90 | <iframe id="frame_doc_article" src="z_frames_article.html"></iframe> |
michael@0 | 91 | <iframe id="frame_doc_checkbox" src="z_frames_checkbox.html"></iframe> |
michael@0 | 92 | <iframe id="frame_doc_textbox" src="z_frames_textbox.html"></iframe> |
michael@0 | 93 | <iframe id="frame_updatedoc" src="z_frames_update.html"></iframe> |
michael@0 | 94 | </body> |
michael@0 | 95 | </html> |