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 | var BUGNUMBER = 464862; |
michael@0 | 8 | var summary = 'Do not assert: ( int32_t(delta) == uint8_t(delta) )'; |
michael@0 | 9 | var actual = ''; |
michael@0 | 10 | var expect = ''; |
michael@0 | 11 | |
michael@0 | 12 | printBugNumber(BUGNUMBER); |
michael@0 | 13 | printStatus (summary); |
michael@0 | 14 | |
michael@0 | 15 | function ygTreeView(id) { |
michael@0 | 16 | this.init(id); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | ygTreeView.prototype.init = function (id) {this.root = new ygRootNode(this);}; |
michael@0 | 20 | |
michael@0 | 21 | function ygNode() {} |
michael@0 | 22 | |
michael@0 | 23 | ygNode.prototype.nextSibling = null; |
michael@0 | 24 | |
michael@0 | 25 | ygNode.prototype.init = function (_32, _33, _34) { |
michael@0 | 26 | this.children = []; |
michael@0 | 27 | this.expanded = _34; |
michael@0 | 28 | if (_33) { |
michael@0 | 29 | this.tree = _33.tree; |
michael@0 | 30 | this.depth = _33.depth + 1; |
michael@0 | 31 | _33.appendChild(this); |
michael@0 | 32 | } |
michael@0 | 33 | }; |
michael@0 | 34 | |
michael@0 | 35 | ygNode.prototype.appendChild = function (_35) { |
michael@0 | 36 | if (this.hasChildren()) { |
michael@0 | 37 | var sib = this.children[this.children.length - 1]; |
michael@0 | 38 | } |
michael@0 | 39 | this.children[this.children.length] = _35; |
michael@0 | 40 | }; |
michael@0 | 41 | |
michael@0 | 42 | ygNode.prototype.getElId = function () {}; |
michael@0 | 43 | |
michael@0 | 44 | ygNode.prototype.getNodeHtml = function () {}; |
michael@0 | 45 | |
michael@0 | 46 | ygNode.prototype.getToggleElId = function () {}; |
michael@0 | 47 | |
michael@0 | 48 | ygNode.prototype.getStyle = function () { |
michael@0 | 49 | var loc = this.nextSibling ? "t" : "l"; |
michael@0 | 50 | var _39 = "n"; |
michael@0 | 51 | if (this.hasChildren(true)) {} |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | ygNode.prototype.hasChildren = function () {return this.children.length > 0;}; |
michael@0 | 55 | |
michael@0 | 56 | ygNode.prototype.getHtml = function () { |
michael@0 | 57 | var sb = []; |
michael@0 | 58 | sb[sb.length] = "<div class=\"ygtvitem\" id=\"" + this.getElId() + "\">"; |
michael@0 | 59 | sb[sb.length] = this.getNodeHtml(); |
michael@0 | 60 | sb[sb.length] = this.getChildrenHtml(); |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | ygNode.prototype.getChildrenHtml = function () { |
michael@0 | 64 | var sb = []; |
michael@0 | 65 | if (this.hasChildren(true) && this.expanded) { |
michael@0 | 66 | sb[sb.length] = this.renderChildren(); |
michael@0 | 67 | } |
michael@0 | 68 | }; |
michael@0 | 69 | |
michael@0 | 70 | ygNode.prototype.renderChildren = function () {return this.completeRender();}; |
michael@0 | 71 | |
michael@0 | 72 | ygNode.prototype.completeRender = function () { |
michael@0 | 73 | var sb = []; |
michael@0 | 74 | for (var i = 0; i < this.children.length; ++i) { |
michael@0 | 75 | sb[sb.length] = this.children[i].getHtml(); |
michael@0 | 76 | } |
michael@0 | 77 | }; |
michael@0 | 78 | |
michael@0 | 79 | ygRootNode.prototype = new ygNode; |
michael@0 | 80 | |
michael@0 | 81 | function ygRootNode(_48) { |
michael@0 | 82 | this.init(null, null, true); |
michael@0 | 83 | } |
michael@0 | 84 | |
michael@0 | 85 | ygTextNode.prototype = new ygNode; |
michael@0 | 86 | |
michael@0 | 87 | function ygTextNode(_49, _50, _51) { |
michael@0 | 88 | this.init(_49, _50, _51); |
michael@0 | 89 | this.setUpLabel(_49); |
michael@0 | 90 | } |
michael@0 | 91 | |
michael@0 | 92 | ygTextNode.prototype.setUpLabel = function (_52) { |
michael@0 | 93 | if (typeof _52 == "string") {} |
michael@0 | 94 | if (_52.target) {} |
michael@0 | 95 | this.labelElId = "ygtvlabelel" + this.index; |
michael@0 | 96 | }; |
michael@0 | 97 | |
michael@0 | 98 | ygTextNode.prototype.getNodeHtml = function () { |
michael@0 | 99 | var sb = new Array; |
michael@0 | 100 | sb[sb.length] = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; |
michael@0 | 101 | sb[sb.length] = "<tr>"; |
michael@0 | 102 | for (i = 0; i < this.depth; ++i) {} |
michael@0 | 103 | sb[sb.length] = " id=\"" + this.getToggleElId() + "\""; |
michael@0 | 104 | sb[sb.length] = " class=\"" + this.getStyle() + "\""; |
michael@0 | 105 | if (this.hasChildren(true)) {} |
michael@0 | 106 | sb[sb.length] = " id=\"" + this.labelElId + "\""; |
michael@0 | 107 | }; |
michael@0 | 108 | |
michael@0 | 109 | function buildUserTree() { |
michael@0 | 110 | userTree = new ygTreeView("userTree"); |
michael@0 | 111 | addMenuNode(userTree, "N", "navheader"); |
michael@0 | 112 | addMenuNode(userTree, "R", "navheader"); |
michael@0 | 113 | addMenuNode(userTree, "S", "navheader"); |
michael@0 | 114 | } |
michael@0 | 115 | |
michael@0 | 116 | function addMenuNode(tree, label, styleClass) { |
michael@0 | 117 | new ygTextNode({}, tree.root, false); |
michael@0 | 118 | } |
michael@0 | 119 | |
michael@0 | 120 | buildUserTree(); |
michael@0 | 121 | userTree.root.getHtml(); |
michael@0 | 122 | |
michael@0 | 123 | reportCompare(expect, actual, summary); |