accessible/tests/mochitest/hittest/test_zoom_text.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:36ebd62b7adf
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>getOffsetAtPoint 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
11 <script type="application/javascript"
12 src="../common.js"></script>
13 <script type="application/javascript"
14 src="../role.js"></script>
15 <script type="application/javascript"
16 src="../layout.js"></script>
17
18 <script type="application/javascript">
19 function doTest()
20 {
21 var hyperText = getNode("paragraph");
22 var textNode = hyperText.firstChild;
23 var [x, y, width, height] = getBounds(textNode);
24 testOffsetAtPoint(hyperText, x + width / 2, y + height / 2,
25 COORDTYPE_SCREEN_RELATIVE,
26 hyperText.textContent.length / 2);
27
28 zoomDocument(document, 2.0);
29
30 var [x, y, width, height] = getBounds(textNode);
31 testOffsetAtPoint(hyperText, x + width / 2, y + height / 2,
32 COORDTYPE_SCREEN_RELATIVE,
33 hyperText.textContent.length / 2);
34
35 zoomDocument(document, 1.0);
36
37 SimpleTest.finish();
38 }
39
40 SimpleTest.waitForExplicitFinish();
41 addA11yLoadEvent(doTest);
42 </script>
43 </head>
44 <body>
45
46 <a target="_blank"
47 href="https://bugzilla.mozilla.org/show_bug.cgi?id=727942"
48 title="getOffsetAtPoint returns incorrect value when page is zoomed">
49 Mozilla Bug 727942
50 </a>
51 <p id="display"></p>
52 <div id="content" style="display: none"></div>
53 <pre id="test">
54 </pre>
55 <p id="paragraph" style="font-family: monospace;">Болтали две сороки</p>
56 </body>
57 </html>

mercurial