Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>The text range boundary when page is zoomed</title> |
michael@0 | 5 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"></meta> |
michael@0 | 6 | <link rel="stylesheet" type="text/css" |
michael@0 | 7 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | <script type="application/javascript" |
michael@0 | 12 | src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 13 | |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../common.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../role.js"></script> |
michael@0 | 18 | <script type="application/javascript" |
michael@0 | 19 | src="../layout.js"></script> |
michael@0 | 20 | <script type="application/javascript" |
michael@0 | 21 | src="../browser.js"></script> |
michael@0 | 22 | |
michael@0 | 23 | <script type="application/javascript"> |
michael@0 | 24 | function testTextNode(aDoc, aContainerID) |
michael@0 | 25 | { |
michael@0 | 26 | var hyperTextNode = aDoc.getElementById(aContainerID); |
michael@0 | 27 | var textNode = hyperTextNode.firstChild; |
michael@0 | 28 | |
michael@0 | 29 | var [x, y, width, height] = getBounds(textNode); |
michael@0 | 30 | testTextBounds(hyperTextNode, 0, -1, [x, y, width, height], |
michael@0 | 31 | COORDTYPE_SCREEN_RELATIVE); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function doTest() |
michael@0 | 35 | { |
michael@0 | 36 | var tabDocument = currentTabDocument(); |
michael@0 | 37 | testTextNode(tabDocument, "p1"); |
michael@0 | 38 | testTextNode(tabDocument, "p2"); |
michael@0 | 39 | |
michael@0 | 40 | zoomDocument(tabDocument, 2.0); |
michael@0 | 41 | |
michael@0 | 42 | testTextNode(tabDocument, "p1"); |
michael@0 | 43 | |
michael@0 | 44 | zoomDocument(tabDocument, 1.0); |
michael@0 | 45 | |
michael@0 | 46 | closeBrowserWindow(); |
michael@0 | 47 | SimpleTest.finish(); |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | var url = "data:text/html,<html>" + |
michael@0 | 51 | "<meta http-equiv='Content-Type' content='text/html;charset=utf-8'>" + |
michael@0 | 52 | "</meta><body>" + |
michael@0 | 53 | "<p id='p1' style='font-family: monospace;'>Tilimilitryamdiya</p>" + |
michael@0 | 54 | "<p id='p2'>ل</p>" |
michael@0 | 55 | "</body></html>"; |
michael@0 | 56 | |
michael@0 | 57 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 58 | openBrowserWindow(doTest, |
michael@0 | 59 | url, |
michael@0 | 60 | { left: 0, top: 0, width: 600, height: 600 }); |
michael@0 | 61 | |
michael@0 | 62 | </script> |
michael@0 | 63 | |
michael@0 | 64 | </head> |
michael@0 | 65 | <body> |
michael@0 | 66 | |
michael@0 | 67 | <a target="_blank" |
michael@0 | 68 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=727942" |
michael@0 | 69 | title="Text range boundaries are incorrect when page is zoomed"> |
michael@0 | 70 | Mozilla Bug 727942 |
michael@0 | 71 | </a> |
michael@0 | 72 | <p id="display"></p> |
michael@0 | 73 | <div id="content" style="display: none"></div> |
michael@0 | 74 | <pre id="test"> |
michael@0 | 75 | </pre> |
michael@0 | 76 | </body> |
michael@0 | 77 | </html> |