Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 4 | type="text/css"?> |
michael@0 | 5 | |
michael@0 | 6 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 7 | title="nsIAccessible XUL textboxes states tests"> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js" /> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../role.js" /> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../states.js" /> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | <![CDATA[ |
michael@0 | 21 | function getInput(aID) |
michael@0 | 22 | { |
michael@0 | 23 | return getNode(aID).inputField; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function doTest() |
michael@0 | 27 | { |
michael@0 | 28 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 29 | // Ordinary textbox |
michael@0 | 30 | testStates(getInput("textbox"), |
michael@0 | 31 | STATE_FOCUSABLE, |
michael@0 | 32 | EXT_STATE_EDITABLE, |
michael@0 | 33 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 34 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 35 | "ordinary textbox"); |
michael@0 | 36 | |
michael@0 | 37 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 38 | // Password textbox |
michael@0 | 39 | testStates(getInput("password"), |
michael@0 | 40 | STATE_FOCUSABLE | STATE_PROTECTED, |
michael@0 | 41 | EXT_STATE_EDITABLE, |
michael@0 | 42 | STATE_UNAVAILABLE, |
michael@0 | 43 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 44 | "password textbox"); |
michael@0 | 45 | |
michael@0 | 46 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 47 | // Textarea |
michael@0 | 48 | testStates(getInput("textarea"), |
michael@0 | 49 | STATE_FOCUSABLE, |
michael@0 | 50 | EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE, |
michael@0 | 51 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 52 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 53 | "multiline textbox"); |
michael@0 | 54 | |
michael@0 | 55 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 56 | // Readonly textbox |
michael@0 | 57 | testStates(getInput("readonly_textbox"), |
michael@0 | 58 | STATE_FOCUSABLE | STATE_READONLY, |
michael@0 | 59 | EXT_STATE_EDITABLE, |
michael@0 | 60 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 61 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 62 | "readonly textbox"); |
michael@0 | 63 | |
michael@0 | 64 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 65 | // Disabled textbox |
michael@0 | 66 | testStates(getInput("disabled_textbox"), |
michael@0 | 67 | STATE_UNAVAILABLE, |
michael@0 | 68 | EXT_STATE_EDITABLE, |
michael@0 | 69 | STATE_FOCUSABLE | STATE_PROTECTED, |
michael@0 | 70 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 71 | "readonly textbox"); |
michael@0 | 72 | |
michael@0 | 73 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 74 | // Readonly textarea |
michael@0 | 75 | testStates(getInput("readonly_textarea"), |
michael@0 | 76 | STATE_FOCUSABLE | STATE_READONLY, |
michael@0 | 77 | EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE, |
michael@0 | 78 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 79 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 80 | "readonly multiline textbox"); |
michael@0 | 81 | |
michael@0 | 82 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 83 | // Disabled textarea |
michael@0 | 84 | testStates(getInput("disabled_textarea"), |
michael@0 | 85 | STATE_UNAVAILABLE, |
michael@0 | 86 | EXT_STATE_EDITABLE| EXT_STATE_MULTI_LINE, |
michael@0 | 87 | STATE_PROTECTED | STATE_FOCUSABLE, |
michael@0 | 88 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 89 | "readonly multiline textbox"); |
michael@0 | 90 | |
michael@0 | 91 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 92 | // Search textbox without search button, searches as you type and filters |
michael@0 | 93 | // a separate control. |
michael@0 | 94 | testStates(getInput("searchbox"), |
michael@0 | 95 | STATE_FOCUSABLE, |
michael@0 | 96 | EXT_STATE_EDITABLE | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 97 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 98 | 0, |
michael@0 | 99 | "searchbox"); |
michael@0 | 100 | |
michael@0 | 101 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 102 | // Search textbox with search button, does not support autoCompletion. |
michael@0 | 103 | testStates(getInput("searchfield"), |
michael@0 | 104 | STATE_FOCUSABLE, |
michael@0 | 105 | EXT_STATE_EDITABLE, |
michael@0 | 106 | STATE_PROTECTED | STATE_UNAVAILABLE, |
michael@0 | 107 | EXT_STATE_SUPPORTS_AUTOCOMPLETION, |
michael@0 | 108 | "searchfield"); |
michael@0 | 109 | |
michael@0 | 110 | SimpleTest.finish(); |
michael@0 | 111 | } |
michael@0 | 112 | |
michael@0 | 113 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 114 | addA11yLoadEvent(doTest); |
michael@0 | 115 | ]]> |
michael@0 | 116 | </script> |
michael@0 | 117 | |
michael@0 | 118 | <hbox flex="1" style="overflow: auto;"> |
michael@0 | 119 | |
michael@0 | 120 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 121 | <a target="_blank" |
michael@0 | 122 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=442648"> |
michael@0 | 123 | Mozilla Bug 442648 |
michael@0 | 124 | </a> |
michael@0 | 125 | <a target="_blank" |
michael@0 | 126 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=648235" |
michael@0 | 127 | title="XUL textbox can inherit more states from underlying HTML input"> |
michael@0 | 128 | Mozilla Bug 648235 |
michael@0 | 129 | </a> |
michael@0 | 130 | <p id="display"></p> |
michael@0 | 131 | <div id="content" style="display: none"></div> |
michael@0 | 132 | <pre id="test"> |
michael@0 | 133 | </pre> |
michael@0 | 134 | </body> |
michael@0 | 135 | |
michael@0 | 136 | <vbox flex="1"> |
michael@0 | 137 | <textbox id="textbox"/> |
michael@0 | 138 | <textbox id="password" type="password"/> |
michael@0 | 139 | <textbox id="textarea" multiline="true" cols="80" rows="5"/> |
michael@0 | 140 | |
michael@0 | 141 | <textbox id="readonly_textbox" readonly="true"/> |
michael@0 | 142 | <textbox id="disabled_textbox" disabled="true"/> |
michael@0 | 143 | <textbox id="readonly_textarea" multiline="true" readonly="true" |
michael@0 | 144 | cols="80" rows="5"/> |
michael@0 | 145 | <textbox id="disabled_textarea" multiline="true" disabled="true" |
michael@0 | 146 | cols="80" rows="5"/> |
michael@0 | 147 | |
michael@0 | 148 | <textbox id="searchbox" flex="1" type="search" results="historyTree"/> |
michael@0 | 149 | <textbox id="searchfield" placeholder="Search all add-ons" |
michael@0 | 150 | type="search" searchbutton="true"/> |
michael@0 | 151 | </vbox> |
michael@0 | 152 | </hbox> |
michael@0 | 153 | </window> |