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 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * File Name: regress-9141.js |
michael@0 | 10 | * Reference: "http://bugzilla.mozilla.org/show_bug.cgi?id=9141"; |
michael@0 | 11 | * Description: |
michael@0 | 12 | * From waldemar@netscape.com: |
michael@0 | 13 | * |
michael@0 | 14 | * The following page crashes the system: |
michael@0 | 15 | * |
michael@0 | 16 | * <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" |
michael@0 | 17 | * "http://www.w3.org/TR/REC-html40/loose.dtd"> |
michael@0 | 18 | * <HTML> |
michael@0 | 19 | * <HEAD> |
michael@0 | 20 | * </HEAD> |
michael@0 | 21 | * <BODY> |
michael@0 | 22 | * <SCRIPT type="text/javascript"> |
michael@0 | 23 | * var s = "x"; |
michael@0 | 24 | * for (var i = 0; i != 13; i++) s += s; |
michael@0 | 25 | * var a = /(?:xx|x)*[slash](s); |
michael@0 | 26 | * var b = /(xx|x)*[slash](s); |
michael@0 | 27 | * document.write("Results = " + a.length + "," + b.length); |
michael@0 | 28 | * </SCRIPT> |
michael@0 | 29 | * </BODY> |
michael@0 | 30 | */ |
michael@0 | 31 | |
michael@0 | 32 | var SECTION = "js1_2"; // provide a document reference (ie, ECMA section) |
michael@0 | 33 | var VERSION = "ECMA_2"; // Version of JavaScript or ECMA |
michael@0 | 34 | var TITLE = "Regression test for bugzilla # 9141"; // Provide ECMA section title or a description |
michael@0 | 35 | var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=9141"; // Provide URL to bugsplat or bugzilla report |
michael@0 | 36 | |
michael@0 | 37 | startTest(); // leave this alone |
michael@0 | 38 | |
michael@0 | 39 | /* |
michael@0 | 40 | * Calls to AddTestCase here. AddTestCase is a function that is defined |
michael@0 | 41 | * in shell.js and takes three arguments: |
michael@0 | 42 | * - a string representation of what is being tested |
michael@0 | 43 | * - the expected result |
michael@0 | 44 | * - the actual result |
michael@0 | 45 | * |
michael@0 | 46 | * For example, a test might look like this: |
michael@0 | 47 | * |
michael@0 | 48 | * var zip = /[\d]{5}$/; |
michael@0 | 49 | * |
michael@0 | 50 | * AddTestCase( |
michael@0 | 51 | * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test |
michael@0 | 52 | * "02134", // expected result |
michael@0 | 53 | * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result |
michael@0 | 54 | * |
michael@0 | 55 | */ |
michael@0 | 56 | |
michael@0 | 57 | var s = "x"; |
michael@0 | 58 | for (var i = 0; i != 13; i++) s += s; |
michael@0 | 59 | var a = /(?:xx|x)*/.exec(s); |
michael@0 | 60 | var b = /(xx|x)*/.exec(s); |
michael@0 | 61 | |
michael@0 | 62 | AddTestCase( "var s = 'x'; for (var i = 0; i != 13; i++) s += s; " + |
michael@0 | 63 | "a = /(?:xx|x)*/.exec(s); a.length", |
michael@0 | 64 | 1, |
michael@0 | 65 | a.length ); |
michael@0 | 66 | |
michael@0 | 67 | AddTestCase( "var b = /(xx|x)*/.exec(s); b.length", |
michael@0 | 68 | 2, |
michael@0 | 69 | b.length ); |
michael@0 | 70 | |
michael@0 | 71 | test(); // leave this alone. this executes the test cases and |
michael@0 | 72 | // displays results. |