accessible/tests/mochitest/hittest/test_zoom_text.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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" />
     8   <script type="application/javascript"
     9           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    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>
    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);
    28       zoomDocument(document, 2.0);
    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);
    35       zoomDocument(document, 1.0);
    37       SimpleTest.finish();
    38     }
    40     SimpleTest.waitForExplicitFinish();
    41     addA11yLoadEvent(doTest);
    42   </script>
    43 </head>
    44 <body>
    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