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 | <html> |
michael@0 | 2 | <!-- |
michael@0 | 3 | https://bugzilla.mozilla.org/show_bug.cgi?id=259332 |
michael@0 | 4 | --> |
michael@0 | 5 | <head> |
michael@0 | 6 | <title>Test for Bug 259332</title> |
michael@0 | 7 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 8 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 9 | </head> |
michael@0 | 10 | <body> |
michael@0 | 11 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=259332">Mozilla Bug 259332</a> |
michael@0 | 12 | <p id="display"></p> |
michael@0 | 13 | <div id="content"> |
michael@0 | 14 | <div id="a">a |
michael@0 | 15 | <div id="a">a</div> |
michael@0 | 16 | <input name="a" value="a"> |
michael@0 | 17 | <div id="b">b</div> |
michael@0 | 18 | <input name="b" value="b"> |
michael@0 | 19 | <div id="c">c</div> |
michael@0 | 20 | </div> |
michael@0 | 21 | <input name="write"> |
michael@0 | 22 | <input name="write"> |
michael@0 | 23 | <input id="write"> |
michael@0 | 24 | </div> |
michael@0 | 25 | <pre id="test"> |
michael@0 | 26 | <script class="testbody" type="text/javascript"> |
michael@0 | 27 | |
michael@0 | 28 | /** Test for Bug 259332 **/ |
michael@0 | 29 | |
michael@0 | 30 | list = document.all.a; |
michael@0 | 31 | ok(list.length == 3, "initial a length"); |
michael@0 | 32 | |
michael@0 | 33 | blist = document.all.b; |
michael@0 | 34 | ok(document.all.b.length == 2, "initial b length"); |
michael@0 | 35 | document.getElementById('b').id = 'a'; |
michael@0 | 36 | ok(document.all.b.nodeName == "INPUT", "just one b"); |
michael@0 | 37 | |
michael@0 | 38 | ok(blist.length == 1, "just one b"); |
michael@0 | 39 | ok(list.length == 4, "one more a"); |
michael@0 | 40 | |
michael@0 | 41 | newDiv = document.createElement('div'); |
michael@0 | 42 | newDiv.id = 'a'; |
michael@0 | 43 | newDiv.innerHTML = 'a'; |
michael@0 | 44 | list[0].appendChild(newDiv); |
michael@0 | 45 | ok(list.length == 5, "two more a"); |
michael@0 | 46 | |
michael@0 | 47 | ok(document.all.c.textContent == 'c', "one c"); |
michael@0 | 48 | document.all.c.id = 'a'; |
michael@0 | 49 | ok(!document.all.c, "no c"); |
michael@0 | 50 | ok(list.length == 6, "three more a"); |
michael@0 | 51 | |
michael@0 | 52 | ok(document.all.write.length == 3, "name is write"); |
michael@0 | 53 | |
michael@0 | 54 | newDiv = document.createElement('div'); |
michael@0 | 55 | newDiv.id = 'd'; |
michael@0 | 56 | newDiv.innerHTML = 'd'; |
michael@0 | 57 | list[0].appendChild(newDiv); |
michael@0 | 58 | ok(document.all.d.textContent == 'd', "new d"); |
michael@0 | 59 | |
michael@0 | 60 | |
michael@0 | 61 | </script> |
michael@0 | 62 | </pre> |
michael@0 | 63 | </body> |
michael@0 | 64 | </html> |