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.
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
5 <!--
6 tree element - simple syntax not recursive tree builder
7 -->
9 <window title="XUL Template Tests" width="500" height="600"
10 onload="test_template();"
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12 <script type="application/javascript"
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
17 <data id="output">
18 <treecols id="treecols" orient="horizontal">
19 <treecol id="treecol" primary="true" label="Name" ordinal="1"/>
20 <treecol label="Species" ordinal="3"/>
21 </treecols>
22 <treechildren>
23 <treeitem id="http://www.some-fictitious-zoo.com/humans/sarah">
24 <treerow>
25 <treecell label="Sarah"/>
26 <treecell/>
27 </treerow>
28 </treeitem>
29 <treeitem step="-1" id="http://www.some-fictitious-zoo.com/mammals" container="true" empty="true">
30 <treerow>
31 <treecell label="Mammals"/>
32 <treecell/>
33 </treerow>
34 </treeitem>
35 <treeitem step="1" id="http://www.some-fictitious-zoo.com/mammals" container="true" empty="true" open="">
36 <treerow>
37 <treecell label="Mammals"/>
38 <treecell/>
39 </treerow>
40 </treeitem>
41 <treeitem step="-4" id="http://www.some-fictitious-zoo.com/crustaceans" container="true" empty="true">
42 <treerow>
43 <treecell label="Crustaceans"/>
44 <treecell/>
45 </treerow>
46 </treeitem>
47 <treeitem step="4" id="http://www.some-fictitious-zoo.com/crustaceans" container="true" empty="true">
48 <treerow>
49 <treecell label="Crustaceans"/>
50 <treecell/>
51 </treerow>
52 </treeitem>
53 <treeitem id="http://www.some-fictitious-zoo.com/birds/emu">
54 <treerow>
55 <treecell label="Emu"/>
56 <treecell/>
57 </treerow>
58 </treeitem>
59 </treechildren>
60 </data>
62 <script src="templates_shared.js"/>
64 <script>
65 <![CDATA[
66 SimpleTest.waitForExplicitFinish();
68 var testid ="tree element - simple syntax not recursive tree builder";
69 var queryType = "rdf";
70 var isTreeBuilder = true;
71 var needsOpen = false;
72 var notWorkingYet = false;
73 var notWorkingYetDynamic = false;
74 var expectedOutput = document.getElementById("output");
76 var changes = [
77 // step 1
78 function(targetds, root) {
79 if (root.view && 1 < root.view.rowCount && root.view.isContainer(1))
80 root.view.toggleOpenState(1);
81 },
82 // step 2
83 function(targetds, root) {
84 var newnode = RDF.GetResource(ZOO_NS + 'mammals/koala');
85 targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'),
86 RDF.GetLiteral('Koala'), true);
87 var container = ContainerUtils.MakeSeq(targetds,
88 RDF.GetResource(ZOO_NS + 'mammals'));
89 container.InsertElementAt(newnode, '4', true);
90 },
91 // step 3
92 function(targetds, root) {
93 var newnode = RDF.GetResource(ZOO_NS + 'crustaceans/lobster');
94 targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'),
95 RDF.GetLiteral('Lobster'), true);
96 var container = ContainerUtils.MakeSeq(targetds,
97 RDF.GetResource(ZOO_NS + 'crustaceans'));
98 container.AppendElement(newnode);
99 },
100 // step 4
101 function(targetds, root) {
102 if (root.view && 11 < root.view.rowCount && root.view.isContainer(11))
103 root.view.toggleOpenState(11);
104 },
105 // step 5
106 function(targetds, root) {
107 if (root.view && 11 < root.view.rowCount && root.view.isContainer(11))
108 root.view.toggleOpenState(11);
109 },
110 // step 6
111 function(targetds, root) {
112 if (root.view && 1 < root.view.rowCount && root.view.isContainer(1))
113 root.view.toggleOpenState(1);
114 }
115 ];
116 ]]>
117 </script>
119 <tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" hidevscroll="true" hidehscroll="true" datasources="rdf:null" flags="dont-recurse dont-build-content" ref="http://www.some-fictitious-zoo.com/marked" id="root">
120 <treecols orient="horizontal" id="treecols">
121 <treecol id="treecol" primary="true" label="Name"/>
122 <treecol label="Species"/>
123 </treecols>
124 <template id="template">
125 <treechildren>
126 <treeitem uri="rdf:*">
127 <treerow>
128 <treecell label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/>
129 <treecell/>
130 </treerow>
131 </treeitem>
132 </treechildren>
133 </template>
134 </tree>
136 </window>