accessible/tests/mochitest/bounds/test_list.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Accessible boundaries when page is zoomed</title>
michael@0 5 <link rel="stylesheet" type="text/css"
michael@0 6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 7
michael@0 8 <script type="application/javascript"
michael@0 9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <script type="application/javascript"
michael@0 11 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
michael@0 12
michael@0 13 <script type="application/javascript"
michael@0 14 src="../common.js"></script>
michael@0 15 <script type="application/javascript"
michael@0 16 src="../role.js"></script>
michael@0 17 <script type="application/javascript"
michael@0 18 src="../layout.js"></script>
michael@0 19
michael@0 20 <script type="application/javascript">
michael@0 21 function doTest()
michael@0 22 {
michael@0 23 // Inside list
michael@0 24 var li = getAccessible("insidelist_item");
michael@0 25 testBounds(li);
michael@0 26
michael@0 27 var [xLI, yLI, widthLI, heightLI] = getBounds(li);
michael@0 28 var bullet = li.firstChild;
michael@0 29 var [x, y, width, height] = getBounds(bullet);
michael@0 30 is(x, xLI,
michael@0 31 "Bullet x should match to list item x");
michael@0 32 ok(y >= yLI,
michael@0 33 "Bullet y= " + y + " should be not less than list item y=" + yLI);
michael@0 34 ok(width < widthLI,
michael@0 35 "Bullet width should be lesser list item width");
michael@0 36 ok(height <= heightLI,
michael@0 37 "Bullet height= " + height + " should be not greater than list item height=" + heightLI);
michael@0 38
michael@0 39 // Outside list
michael@0 40 li = getAccessible("outsidelist_item");
michael@0 41 var [xLIElm, yLIElm, widthLIElm, heightLIElm] = getBoundsForDOMElm(li);
michael@0 42 [xLI, yLI, widthLI, heightLI] = getBounds(li);
michael@0 43
michael@0 44 ok(xLI < xLIElm,
michael@0 45 "Outside list item x=" + xLI + " should be lesser than list item element x=" + xLIElm);
michael@0 46 is(yLI, yLIElm,
michael@0 47 "Outside list item y should match to list item element y");
michael@0 48 ok(widthLI > widthLIElm,
michael@0 49 "Outside list item width=" + widthLI + " should be greater than list item element width=" + widthLIElm);
michael@0 50 is(heightLI, heightLIElm,
michael@0 51 "Outside list item height should match to list item element height");
michael@0 52
michael@0 53 SimpleTest.finish();
michael@0 54 }
michael@0 55
michael@0 56 SimpleTest.waitForExplicitFinish();
michael@0 57 addA11yLoadEvent(doTest);
michael@0 58 </script>
michael@0 59 </head>
michael@0 60 <body>
michael@0 61
michael@0 62 <a target="_blank"
michael@0 63 href="https://bugzilla.mozilla.org/show_bug.cgi?id=754627"
michael@0 64 title="GetBounds on bullet return wrong values">
michael@0 65 Mozilla Bug 754627
michael@0 66 </a>
michael@0 67 <p id="display"></p>
michael@0 68 <div id="content" style="display: none"></div>
michael@0 69 <pre id="test">
michael@0 70 </pre>
michael@0 71
michael@0 72 <ul style="list-style-position: inside;">
michael@0 73 <li id="insidelist_item">item</li>
michael@0 74 </ul>
michael@0 75
michael@0 76 <ul style="list-style-position: outside;">
michael@0 77 <li id="outsidelist_item">item</li>
michael@0 78 </ul>
michael@0 79
michael@0 80 </body>
michael@0 81 </html>

mercurial