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