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 xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 2 | <!-- |
michael@0 | 3 | https://bugzilla.mozilla.org/show_bug.cgi?id=400705 |
michael@0 | 4 | --> |
michael@0 | 5 | <head> |
michael@0 | 6 | <title>Test for Bug 400705</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 | <bindings xmlns="http://www.mozilla.org/xbl"> |
michael@0 | 10 | <binding id="test"> |
michael@0 | 11 | <implementation> |
michael@0 | 12 | <field name="a">XPCNativeWrapper.unwrap(window).countera++</field> |
michael@0 | 13 | <field name="b">XPCNativeWrapper.unwrap(window).counterb++</field> |
michael@0 | 14 | </implementation> |
michael@0 | 15 | </binding> |
michael@0 | 16 | </bindings> |
michael@0 | 17 | </head> |
michael@0 | 18 | <body> |
michael@0 | 19 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=400705">Mozilla Bug 400705</a> |
michael@0 | 20 | <p id="display" style="-moz-binding: url(#test)"></p> |
michael@0 | 21 | <div id="content" style="display: none"> |
michael@0 | 22 | |
michael@0 | 23 | </div> |
michael@0 | 24 | <pre id="test"> |
michael@0 | 25 | <script class="testbody" type="text/javascript"> |
michael@0 | 26 | <![CDATA[ |
michael@0 | 27 | /** Test for Bug 400705 **/ |
michael@0 | 28 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 29 | |
michael@0 | 30 | addLoadEvent(function() { |
michael@0 | 31 | window.countera = 0; |
michael@0 | 32 | window.counterb = 0; |
michael@0 | 33 | |
michael@0 | 34 | var d = $("display"); |
michael@0 | 35 | // Control to make sure fields are lazy and all |
michael@0 | 36 | d.a; |
michael@0 | 37 | is(window.countera, 1, "Should have evaluated field"); |
michael@0 | 38 | |
michael@0 | 39 | d.parentNode.removeChild(d); |
michael@0 | 40 | is(window.counterb, 0, "Should not evaluate field on binding teardown"); |
michael@0 | 41 | SimpleTest.finish(); |
michael@0 | 42 | }); |
michael@0 | 43 | ]]> |
michael@0 | 44 | </script> |
michael@0 | 45 | </pre> |
michael@0 | 46 | </body> |
michael@0 | 47 | </html> |
michael@0 | 48 |