test_obj_css.html (8499B)
1 <html> 2 <head> 3 <title>CSS-like attributes tests</title> 4 <link rel="stylesheet" type="text/css" 5 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 6 7 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 8 9 <script type="application/javascript" 10 src="../common.js"></script> 11 <script type="application/javascript" 12 src="../attributes.js"></script> 13 <script type="application/javascript" 14 src="../events.js"></script> 15 16 <script type="application/javascript"> 17 var gQueue = null; 18 19 function removeElm(aID) { 20 this.node = getNode(aID); 21 this.accessible = getAccessible(aID); 22 23 this.eventSeq = [ 24 new invokerChecker(EVENT_HIDE, this.accessible), 25 ]; 26 27 this.invoke = function removeElm_invoke() { 28 this.node.remove(); 29 }; 30 31 this.check = function removeElm_check() { 32 testAbsentCSSAttrs(this.accessible); 33 }; 34 35 this.getID = function removeElm_getID() { 36 return "test CSS-based attributes on removed accessible"; 37 }; 38 } 39 40 function doTest() { 41 // CSS display 42 testCSSAttrs("display_block"); 43 testCSSAttrs("display_inline"); 44 testCSSAttrs("display_inline-block"); 45 testCSSAttrs("display_list-item"); 46 testCSSAttrs("display_table"); 47 testCSSAttrs("display_inline-table"); 48 testCSSAttrs("display_table-row-group"); 49 testCSSAttrs("display_table-column"); 50 testCSSAttrs("display_table-column-group"); 51 testCSSAttrs("display_table-header-group"); 52 testCSSAttrs("display_table-footer-group"); 53 testCSSAttrs("display_table-row"); 54 testCSSAttrs("display_table-cell"); 55 testCSSAttrs("display_table-caption"); 56 57 // CSS text-align 58 testCSSAttrs("text-align_left"); 59 testCSSAttrs("text-align_right"); 60 testCSSAttrs("text-align_center"); 61 testCSSAttrs("text-align_justify"); 62 testCSSAttrs("text-align_inherit"); 63 64 // CSS text-indent 65 testCSSAttrs("text-indent_em"); 66 testCSSAttrs("text-indent_ex"); 67 testCSSAttrs("text-indent_in"); 68 testCSSAttrs("text-indent_cm"); 69 testCSSAttrs("text-indent_mm"); 70 testCSSAttrs("text-indent_pt"); 71 testCSSAttrs("text-indent_pc"); 72 testCSSAttrs("text-indent_px"); 73 testCSSAttrs("text-indent_percent"); 74 testCSSAttrs("text-indent_inherit"); 75 76 // CSS margin 77 testCSSAttrs("margin_em"); 78 testCSSAttrs("margin_ex"); 79 testCSSAttrs("margin_in"); 80 testCSSAttrs("margin_cm"); 81 testCSSAttrs("margin_mm"); 82 testCSSAttrs("margin_pt"); 83 testCSSAttrs("margin_pc"); 84 testCSSAttrs("margin_px"); 85 testCSSAttrs("margin_percent"); 86 testCSSAttrs("margin_auto"); 87 testCSSAttrs("margin_inherit"); 88 89 testCSSAttrs("margin-left"); 90 testCSSAttrs("margin-right"); 91 testCSSAttrs("margin-top"); 92 testCSSAttrs("margin-bottom"); 93 94 // Elements 95 testCSSAttrs("span"); 96 testCSSAttrs("div"); 97 testCSSAttrs("p"); 98 testCSSAttrs("input"); 99 testCSSAttrs("table"); 100 testCSSAttrs("tr"); 101 testCSSAttrs("td"); 102 103 // no CSS-based object attributes 104 testAbsentCSSAttrs(getAccessible("listitem").firstChild); 105 106 gQueue = new eventQueue(); 107 gQueue.push(new removeElm("div")); 108 gQueue.invoke(); // SimpleTest.finish(); 109 } 110 111 SimpleTest.waitForExplicitFinish(); 112 addA11yLoadEvent(doTest); 113 </script> 114 </head> 115 <body> 116 117 <a target="_blank" 118 href="https://bugzilla.mozilla.org/show_bug.cgi?id=439566" 119 title="Include the css display property as an IAccessible2 object attribute"> 120 Mozilla Bug 439566 121 </a> 122 <a target="_blank" 123 href="https://bugzilla.mozilla.org/show_bug.cgi?id=460932" 124 title="text-indent and text-align should really be object attribute"> 125 Mozilla Bug 460932 126 </a> 127 <a target="_blank" 128 href="https://bugzilla.mozilla.org/show_bug.cgi?id=689540" 129 title="Expose IA2 margin- object attributes"> 130 Mozilla Bug 689540 131 </a> 132 <a target="_blank" 133 href="https://bugzilla.mozilla.org/show_bug.cgi?id=714579" 134 title="Don't use GetComputedStyle for object attribute calculation"> 135 Mozilla Bug 714579 136 </a> 137 <a target="_blank" 138 href="https://bugzilla.mozilla.org/show_bug.cgi?id=729831" 139 title="Don't expose CSS-based object attributes on not in tree accessible and accessible having no DOM element"> 140 Mozilla Bug 729831 141 </a> 142 143 <p id="display"></p> 144 <div id="content" style="display: none"></div> 145 <pre id="test"> 146 </pre> 147 148 <div id="display_block" role="img" 149 style="display: block;">display: block</div> 150 <div id="display_inline" role="img" 151 style="display: inline;">display: inline</div> 152 <div id="display_inline-block" role="img" 153 style="display: inline-block;">display: inline-block</div> 154 <div id="display_list-item" role="img" 155 style="display: list-item;">display: list-item</div> 156 <div id="display_table" role="img" 157 style="display: table;">display: table</div> 158 <div id="display_inline-table" role="img" 159 style="display: inline-table;">display: inline-table</div> 160 <div id="display_table-row-group" role="img" 161 style="display: table-row-group;">display: table-row-group</div> 162 <div id="display_table-column" role="img" 163 style="display: table-column;">display: table-column</div> 164 <div id="display_table-column-group" role="img" 165 style="display: table-column-group;">display: table-column-group</div> 166 <div id="display_table-header-group" role="img" 167 style="display: table-header-group;">display: table-header-group</div> 168 <div id="display_table-footer-group" role="img" 169 style="display: table-footer-group;">display: table-footer-group</div> 170 <div id="display_table-row" role="img" 171 style="display: table-row;">display: table-row</div> 172 <div id="display_table-cell" role="img" 173 style="display: table-cell;">display: table-cell</div> 174 <div id="display_table-caption" role="img" 175 style="display: table-caption;">display: table-caption</div> 176 177 <p id="text-align_left" style="text-align: left;">text-align: left</p> 178 <p id="text-align_right" style="text-align: right;">text-align: right</p> 179 <p id="text-align_center" style="text-align: center;">text-align: center</p> 180 <p id="text-align_justify" style="text-align: justify;">text-align: justify</p> 181 <p id="text-align_inherit" style="text-align: inherit;">text-align: inherit</p> 182 183 <p id="text-indent_em" style="text-indent: 0.5em;">text-indent: 0.5em</p> 184 <p id="text-indent_ex" style="text-indent: 1ex;">text-indent: 1ex</p> 185 <p id="text-indent_in" style="text-indent: 0.5in;">text-indent: 0.5in</p> 186 <p id="text-indent_cm" style="text-indent: 2cm;">text-indent: 2cm</p> 187 <p id="text-indent_mm" style="text-indent: 10mm;">text-indent: 10mm</p> 188 <p id="text-indent_pt" style="text-indent: 30pt;">text-indent: 30pt</p> 189 <p id="text-indent_pc" style="text-indent: 2pc;">text-indent: 2pc</p> 190 <p id="text-indent_px" style="text-indent: 5px;">text-indent: 5px</p> 191 <p id="text-indent_percent" style="text-indent: 10%;">text-indent: 10%</p> 192 <p id="text-indent_inherit" style="text-indent: inherit;">text-indent: inherit</p> 193 194 <p id="margin_em" style="margin: 0.5em;">margin: 0.5em</p> 195 <p id="margin_ex" style="margin: 1ex;">margin: 1ex</p> 196 <p id="margin_in" style="margin: 0.5in;">margin: 0.5in</p> 197 <p id="margin_cm" style="margin: 2cm;">margin: 2cm</p> 198 <p id="margin_mm" style="margin: 10mm;">margin: 10mm</p> 199 <p id="margin_pt" style="margin: 30pt;">margin: 30pt</p> 200 <p id="margin_pc" style="margin: 2pc;">margin: 2pc</p> 201 <p id="margin_px" style="margin: 5px;">margin: 5px</p> 202 <p id="margin_percent" style="margin: 10%;">margin: 10%</p> 203 <p id="margin_auto" style="margin: auto;">margin: auto</p> 204 <p id="margin_inherit" style="margin: inherit;">margin: inherit</p> 205 206 <p id="margin-left" style="margin-left: 11px;">margin-left: 11px</p> 207 <p id="margin-right" style="margin-right: 21px;">margin-right</p> 208 <p id="margin-top" style="margin-top: 31px;">margin-top: 31px</p> 209 <p id="margin-bottom" style="margin-bottom: 41px;">margin-bottom: 41px</p> 210 211 <span id="span" role="group">It's span</span> 212 <div id="div">It's div</div> 213 <p id="p">It's paragraph"</p> 214 <input id="input"/> 215 <table id="table" style="margin: 2px; text-align: center; text-indent: 10%;"> 216 <tr id="tr" role="group"> 217 <td id="td">td</td> 218 </tr> 219 </table> 220 221 <ul> 222 <li id="listitem">item 223 </ul> 224 </body> 225 </html>