accessible/tests/mochitest/attributes/test_obj_css.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/attributes/test_obj_css.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,231 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +  <title>CSS-like attributes tests</title>
     1.7 +  <link rel="stylesheet" type="text/css"
     1.8 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     1.9 +
    1.10 +  <script type="application/javascript"
    1.11 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +
    1.13 +  <script type="application/javascript"
    1.14 +          src="../common.js"></script>
    1.15 +  <script type="application/javascript"
    1.16 +          src="../attributes.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../events.js"></script>
    1.19 +
    1.20 +  <script type="application/javascript">
    1.21 +    var gQueue = null;
    1.22 +
    1.23 +    function removeElm(aID)
    1.24 +    {
    1.25 +      this.node = getNode(aID);
    1.26 +      this.accessible = getAccessible(aID);
    1.27 +
    1.28 +      this.eventSeq = [
    1.29 +        new invokerChecker(EVENT_HIDE, this.accessible)
    1.30 +      ];
    1.31 +
    1.32 +      this.invoke = function removeElm_invoke()
    1.33 +      {
    1.34 +        this.node.parentNode.removeChild(this.node);
    1.35 +      }
    1.36 +
    1.37 +      this.check = function removeElm_check()
    1.38 +      {
    1.39 +        testAbsentCSSAttrs(this.accessible);
    1.40 +      }
    1.41 +
    1.42 +      this.getID = function removeElm_getID()
    1.43 +      {
    1.44 +        return "test CSS-based attributes on removed accessible";
    1.45 +      }
    1.46 +    }
    1.47 +
    1.48 +    function doTest()
    1.49 +    {
    1.50 +      // CSS display
    1.51 +      testCSSAttrs("display_block");
    1.52 +      testCSSAttrs("display_inline");
    1.53 +      testCSSAttrs("display_inline-block");
    1.54 +      testCSSAttrs("display_list-item");
    1.55 +      testCSSAttrs("display_table");
    1.56 +      testCSSAttrs("display_inline-table");
    1.57 +      testCSSAttrs("display_table-row-group");
    1.58 +      testCSSAttrs("display_table-column");
    1.59 +      testCSSAttrs("display_table-column-group");
    1.60 +      testCSSAttrs("display_table-header-group");
    1.61 +      testCSSAttrs("display_table-footer-group");
    1.62 +      testCSSAttrs("display_table-row");
    1.63 +      testCSSAttrs("display_table-cell");
    1.64 +      testCSSAttrs("display_table-caption");
    1.65 +
    1.66 +      // CSS text-align
    1.67 +      testCSSAttrs("text-align_left");
    1.68 +      testCSSAttrs("text-align_right");
    1.69 +      testCSSAttrs("text-align_center");
    1.70 +      testCSSAttrs("text-align_justify");
    1.71 +      testCSSAttrs("text-align_inherit");
    1.72 +
    1.73 +      // CSS text-indent
    1.74 +      testCSSAttrs("text-indent_em");
    1.75 +      testCSSAttrs("text-indent_ex");
    1.76 +      testCSSAttrs("text-indent_in");
    1.77 +      testCSSAttrs("text-indent_cm");
    1.78 +      testCSSAttrs("text-indent_mm");
    1.79 +      testCSSAttrs("text-indent_pt");
    1.80 +      testCSSAttrs("text-indent_pc");
    1.81 +      testCSSAttrs("text-indent_px");
    1.82 +      testCSSAttrs("text-indent_percent");
    1.83 +      testCSSAttrs("text-indent_inherit");
    1.84 +
    1.85 +      // CSS margin
    1.86 +      testCSSAttrs("margin_em");
    1.87 +      testCSSAttrs("margin_ex");
    1.88 +      testCSSAttrs("margin_in");
    1.89 +      testCSSAttrs("margin_cm");
    1.90 +      testCSSAttrs("margin_mm");
    1.91 +      testCSSAttrs("margin_pt");
    1.92 +      testCSSAttrs("margin_pc");
    1.93 +      testCSSAttrs("margin_px");
    1.94 +      testCSSAttrs("margin_percent");
    1.95 +      testCSSAttrs("margin_auto");
    1.96 +      testCSSAttrs("margin_inherit");
    1.97 +
    1.98 +      testCSSAttrs("margin-left");
    1.99 +      testCSSAttrs("margin-right");
   1.100 +      testCSSAttrs("margin-top");
   1.101 +      testCSSAttrs("margin-bottom");
   1.102 +
   1.103 +      // Elements
   1.104 +      testCSSAttrs("span");
   1.105 +      testCSSAttrs("div");
   1.106 +      testCSSAttrs("p");
   1.107 +      testCSSAttrs("input");
   1.108 +      testCSSAttrs("table");
   1.109 +      testCSSAttrs("tr");
   1.110 +      testCSSAttrs("td");
   1.111 +
   1.112 +      // no CSS-based object attributes
   1.113 +      testAbsentCSSAttrs(getAccessible("listitem").firstChild);
   1.114 +
   1.115 +      gQueue = new eventQueue();
   1.116 +      gQueue.push(new removeElm("div"));
   1.117 +      gQueue.invoke(); // SimpleTest.finish();
   1.118 +    }
   1.119 +
   1.120 +    SimpleTest.waitForExplicitFinish();
   1.121 +    addA11yLoadEvent(doTest);
   1.122 +  </script>
   1.123 +</head>
   1.124 +<body>
   1.125 +
   1.126 +  <a target="_blank"
   1.127 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=439566"
   1.128 +     title="Include the css display property as an IAccessible2 object attribute">
   1.129 +    Mozilla Bug 439566
   1.130 +  </a>
   1.131 +  <a target="_blank"
   1.132 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=460932"
   1.133 +     title="text-indent and text-align should really be object attribute">
   1.134 +    Mozilla Bug 460932
   1.135 +  </a>
   1.136 +  <a target="_blank"
   1.137 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=689540"
   1.138 +     title="Expose IA2 margin- object attributes">
   1.139 +    Mozilla Bug 689540
   1.140 +  </a>
   1.141 +  <a target="_blank"
   1.142 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=714579"
   1.143 +     title="Don't use GetComputedStyle for object attribute calculation">
   1.144 +    Mozilla Bug 714579
   1.145 +  </a>
   1.146 +  <a target="_blank"
   1.147 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=729831"
   1.148 +     title="Don't expose CSS-based object attributes on not in tree accessible and accessible having no DOM element">
   1.149 +    Mozilla Bug 729831
   1.150 +  </a>
   1.151 +
   1.152 +  <p id="display"></p>
   1.153 +  <div id="content" style="display: none"></div>
   1.154 +  <pre id="test">
   1.155 +  </pre>
   1.156 +
   1.157 +  <div id="display_block" role="img"
   1.158 +       style="display: block;">display: block</div>
   1.159 +  <div id="display_inline" role="img"
   1.160 +       style="display: inline;">display: inline</div>
   1.161 +  <div id="display_inline-block" role="img"
   1.162 +       style="display: inline-block;">display: inline-block</div>
   1.163 +  <div id="display_list-item" role="img"
   1.164 +       style="display: list-item;">display: list-item</div>
   1.165 +  <div id="display_table" role="img"
   1.166 +       style="display: table;">display: table</div>
   1.167 +  <div id="display_inline-table" role="img"
   1.168 +       style="display: inline-table;">display: inline-table</div>
   1.169 +  <div id="display_table-row-group" role="img"
   1.170 +       style="display: table-row-group;">display: table-row-group</div>
   1.171 +  <div id="display_table-column" role="img"
   1.172 +       style="display: table-column;">display: table-column</div>
   1.173 +  <div id="display_table-column-group" role="img"
   1.174 +       style="display: table-column-group;">display: table-column-group</div>
   1.175 +  <div id="display_table-header-group" role="img"
   1.176 +       style="display: table-header-group;">display: table-header-group</div>
   1.177 +  <div id="display_table-footer-group" role="img"
   1.178 +       style="display: table-footer-group;">display: table-footer-group</div>
   1.179 +  <div id="display_table-row" role="img"
   1.180 +       style="display: table-row;">display: table-row</div>
   1.181 +  <div id="display_table-cell" role="img"
   1.182 +       style="display: table-cell;">display: table-cell</div>
   1.183 +  <div id="display_table-caption" role="img"
   1.184 +       style="display: table-caption;">display: table-caption</div>
   1.185 +
   1.186 +  <p id="text-align_left" style="text-align: left;">text-align: left</p>
   1.187 +  <p id="text-align_right" style="text-align: right;">text-align: right</p>
   1.188 +  <p id="text-align_center" style="text-align: center;">text-align: center</p>
   1.189 +  <p id="text-align_justify" style="text-align: justify;">text-align: justify</p>
   1.190 +  <p id="text-align_inherit" style="text-align: inherit;">text-align: inherit</p>
   1.191 +
   1.192 +  <p id="text-indent_em" style="text-indent: 0.5em;">text-indent: 0.5em</p>
   1.193 +  <p id="text-indent_ex" style="text-indent: 1ex;">text-indent: 1ex</p>
   1.194 +  <p id="text-indent_in" style="text-indent: 0.5in;">text-indent: 0.5in</p>
   1.195 +  <p id="text-indent_cm" style="text-indent: 2cm;">text-indent: 2cm</p>
   1.196 +  <p id="text-indent_mm" style="text-indent: 10mm;">text-indent: 10mm</p>
   1.197 +  <p id="text-indent_pt" style="text-indent: 30pt;">text-indent: 30pt</p>
   1.198 +  <p id="text-indent_pc" style="text-indent: 2pc;">text-indent: 2pc</p>
   1.199 +  <p id="text-indent_px" style="text-indent: 5px;">text-indent: 5px</p>
   1.200 +  <p id="text-indent_percent" style="text-indent: 10%;">text-indent: 10%</p>
   1.201 +  <p id="text-indent_inherit" style="text-indent: inherit;">text-indent: inherit</p>
   1.202 +
   1.203 +  <p id="margin_em" style="margin: 0.5em;">margin: 0.5em</p>
   1.204 +  <p id="margin_ex" style="margin: 1ex;">margin: 1ex</p>
   1.205 +  <p id="margin_in" style="margin: 0.5in;">margin: 0.5in</p>
   1.206 +  <p id="margin_cm" style="margin: 2cm;">margin: 2cm</p>
   1.207 +  <p id="margin_mm" style="margin: 10mm;">margin: 10mm</p>
   1.208 +  <p id="margin_pt" style="margin: 30pt;">margin: 30pt</p>
   1.209 +  <p id="margin_pc" style="margin: 2pc;">margin: 2pc</p>
   1.210 +  <p id="margin_px" style="margin: 5px;">margin: 5px</p>
   1.211 +  <p id="margin_percent" style="margin: 10%;">margin: 10%</p>
   1.212 +  <p id="margin_auto" style="margin: auto;">margin: auto</p>
   1.213 +  <p id="margin_inherit" style="margin: inherit;">margin: inherit</p>
   1.214 +
   1.215 +  <p id="margin-left" style="margin-left: 11px;">margin-left: 11px</p>
   1.216 +  <p id="margin-right" style="margin-right: 21px;">margin-right</p>
   1.217 +  <p id="margin-top" style="margin-top: 31px;">margin-top: 31px</p>
   1.218 +  <p id="margin-bottom" style="margin-bottom: 41px;">margin-bottom: 41px</p>
   1.219 +
   1.220 +  <span id="span" role="group">It's span</span>
   1.221 +  <div id="div">It's div</div>
   1.222 +  <p id="p">It's paragraph"</p>
   1.223 +  <input id="input"/>
   1.224 +  <table id="table" style="margin: 2px; text-align: center; text-indent: 10%;">
   1.225 +    <tr id="tr" role="group">
   1.226 +      <td id="td">td</td>
   1.227 +    </tr>
   1.228 +  </table>
   1.229 +
   1.230 +  <ul>
   1.231 +    <li id="listitem">item
   1.232 +  </ul>
   1.233 +</body>
   1.234 +</html>

mercurial