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 | <title>Test for Bug 922669</title> |
michael@0 | 3 | <script src="/MochiKit/MochiKit.js"></script> |
michael@0 | 4 | <script src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 5 | <script src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 6 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> |
michael@0 | 7 | |
michael@0 | 8 | <style></style> |
michael@0 | 9 | |
michael@0 | 10 | <script> |
michael@0 | 11 | var style = document.querySelector("style"); |
michael@0 | 12 | |
michael@0 | 13 | var gValidTests = [ |
michael@0 | 14 | "::-moz-progress-bar", |
michael@0 | 15 | "::-moz-progress-bar:hover", |
michael@0 | 16 | "::-moz-progress-bar:active", |
michael@0 | 17 | "::-moz-progress-bar:focus", |
michael@0 | 18 | "::-moz-progress-bar:hover:focus", |
michael@0 | 19 | "#a::-moz-progress-bar:hover", |
michael@0 | 20 | ":hover::-moz-progress-bar" |
michael@0 | 21 | ]; |
michael@0 | 22 | |
michael@0 | 23 | var gInvalidTests = [ |
michael@0 | 24 | "::foo", |
michael@0 | 25 | "::-moz-progress-bar::-moz-progress-bar", |
michael@0 | 26 | "::-moz-progress-bar::first-line", |
michael@0 | 27 | "::-moz-progress-bar#a", |
michael@0 | 28 | "::-moz-progress-bar:invalid", |
michael@0 | 29 | "::-moz-focus-inner:active" |
michael@0 | 30 | ]; |
michael@0 | 31 | |
michael@0 | 32 | gValidTests.forEach(function(aTest) { |
michael@0 | 33 | style.textContent = aTest + "{}"; |
michael@0 | 34 | is(style.sheet.cssRules.length, 1, aTest); |
michael@0 | 35 | style.textContent = ""; |
michael@0 | 36 | }); |
michael@0 | 37 | |
michael@0 | 38 | gInvalidTests.forEach(function(aTest) { |
michael@0 | 39 | style.textContent = aTest + "{}"; |
michael@0 | 40 | is(style.sheet.cssRules.length, 0, aTest); |
michael@0 | 41 | style.textContent = ""; |
michael@0 | 42 | }); |
michael@0 | 43 | </script> |