1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/bounds/test_list.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>Accessible boundaries when page is zoomed</title> 1.8 + <link rel="stylesheet" type="text/css" 1.9 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.10 + 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" 1.14 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.15 + 1.16 + <script type="application/javascript" 1.17 + src="../common.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../role.js"></script> 1.20 + <script type="application/javascript" 1.21 + src="../layout.js"></script> 1.22 + 1.23 + <script type="application/javascript"> 1.24 + function doTest() 1.25 + { 1.26 + // Inside list 1.27 + var li = getAccessible("insidelist_item"); 1.28 + testBounds(li); 1.29 + 1.30 + var [xLI, yLI, widthLI, heightLI] = getBounds(li); 1.31 + var bullet = li.firstChild; 1.32 + var [x, y, width, height] = getBounds(bullet); 1.33 + is(x, xLI, 1.34 + "Bullet x should match to list item x"); 1.35 + ok(y >= yLI, 1.36 + "Bullet y= " + y + " should be not less than list item y=" + yLI); 1.37 + ok(width < widthLI, 1.38 + "Bullet width should be lesser list item width"); 1.39 + ok(height <= heightLI, 1.40 + "Bullet height= " + height + " should be not greater than list item height=" + heightLI); 1.41 + 1.42 + // Outside list 1.43 + li = getAccessible("outsidelist_item"); 1.44 + var [xLIElm, yLIElm, widthLIElm, heightLIElm] = getBoundsForDOMElm(li); 1.45 + [xLI, yLI, widthLI, heightLI] = getBounds(li); 1.46 + 1.47 + ok(xLI < xLIElm, 1.48 + "Outside list item x=" + xLI + " should be lesser than list item element x=" + xLIElm); 1.49 + is(yLI, yLIElm, 1.50 + "Outside list item y should match to list item element y"); 1.51 + ok(widthLI > widthLIElm, 1.52 + "Outside list item width=" + widthLI + " should be greater than list item element width=" + widthLIElm); 1.53 + is(heightLI, heightLIElm, 1.54 + "Outside list item height should match to list item element height"); 1.55 + 1.56 + SimpleTest.finish(); 1.57 + } 1.58 + 1.59 + SimpleTest.waitForExplicitFinish(); 1.60 + addA11yLoadEvent(doTest); 1.61 + </script> 1.62 +</head> 1.63 +<body> 1.64 + 1.65 + <a target="_blank" 1.66 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=754627" 1.67 + title="GetBounds on bullet return wrong values"> 1.68 + Mozilla Bug 754627 1.69 + </a> 1.70 + <p id="display"></p> 1.71 + <div id="content" style="display: none"></div> 1.72 + <pre id="test"> 1.73 + </pre> 1.74 + 1.75 + <ul style="list-style-position: inside;"> 1.76 + <li id="insidelist_item">item</li> 1.77 + </ul> 1.78 + 1.79 + <ul style="list-style-position: outside;"> 1.80 + <li id="outsidelist_item">item</li> 1.81 + </ul> 1.82 + 1.83 +</body> 1.84 +</html>