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