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=829816
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 829816</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12 <style type="text/css">
13 b { content: "\0"; counter-reset: \0 }
14 b { content: "\00"; counter-reset: \00 }
15 b { content: "\000"; counter-reset: \000 }
16 b { content: "\0000"; counter-reset: \0000 }
17 b { content: "\00000"; counter-reset: \00000 }
18 b { content: "\000000"; counter-reset: \000000 }
19 </style>
21 <!-- U+0000 characters in <style> would be replaced by the HTML parser -->
22 <link rel="stylesheet" type="text/css" href="file_bug829816.css"/>
24 <script type="application/javascript">
26 /** Test for Bug 829816 **/
27 var ss = document.styleSheets[1];
29 for (var i = 0; i < 6; i++) {
30 is(ss.cssRules[i].style.content, "\"\uFFFD\"",
31 "\\0 in strings should be converted to U+FFFD");
32 is(ss.cssRules[i].style.counterReset, "\uFFFD",
33 "\\0 in identifiers should be converted to U+FFFD");
34 }
36 is(document.styleSheets[2].cssRules[0].style.content, "\"\uFFFD\"",
37 "U+0000 in strings should be converted to U+FFFD");
38 is(document.styleSheets[2].cssRules[0].style.counterReset, "\uFFFD",
39 "U+0000 in identifiers should be converted to U+FFFD");
40 is(document.styleSheets[2].cssRules[1].style.content, "\"\uFFFD\"",
41 "U+0000 in strings should be converted to U+FFFD");
42 is(document.styleSheets[2].cssRules[1].style.counterReset, "\uFFFD",
43 "U+0000 in identifiers should be converted to U+FFFD");
46 </script>
47 </head>
48 <body>
49 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829816">Mozilla Bug 829816</a>
50 <p id="display"></p>
51 <div id="content" style="display: none">
52 </div>
53 <pre id="test">
54 </pre>
55 </body>
56 </html>