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.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=593959
5 -->
6 <head>
7 <title>Test for Bug 593959</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <style>
12 body:active {
13 background: red;
14 }
15 </style>
16 </head>
17 <body>
18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=593959">Mozilla Bug 593959</a>
19 <p id="display"></p>
20 <div id="content" style="display: none">
22 </div>
23 <pre id="test">
24 <script type="application/javascript">
26 /** Test for Bug 593959 **/
28 function doTest() {
29 var utils = SpecialPowers.getDOMWindowUtils(window);
30 var e = document.createEvent("MouseEvent");
31 e.initEvent("mousedown", false, false, window, 0, 1, 1, 1, 1,
32 false, false, false, false, 0, null);
33 utils.dispatchDOMEventViaPresShell(document.body, e, true);
35 is(document.querySelector("body:active"), document.body, "body should be active!")
37 var ifrwindow = document.getElementById("ifr").contentWindow;
39 var utils2 = SpecialPowers.getDOMWindowUtils(ifrwindow);
41 var e2 = ifrwindow.document.createEvent("MouseEvent");
42 e2.initEvent("mouseup", false, false, ifrwindow, 0, 1, 1, 1, 1,
43 false, false, false, false, 0, null);
44 utils2.dispatchDOMEventViaPresShell(ifrwindow.document.body, e2, true);
46 isnot(document.querySelector("body:active"), document.body, "body shouldn't be active!")
48 SimpleTest.finish();
49 }
51 SimpleTest.waitForExplicitFinish();
52 addLoadEvent(doTest);
56 </script>
57 </pre>
58 <iframe id="ifr"></iframe>
59 </body>
60 </html>