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