content/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntax.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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   html element - simple syntax
     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" xmlns:html="http://www.w3.org/1999/xhtml">
    18     <html:p step="3" id="http://www.some-fictitious-zoo.com/birds/wren" title="Wren"/>
    19     <html:p id="http://www.some-fictitious-zoo.com/birds/emu" title="Emu"/>
    20     <html:p step="-4" id="http://www.some-fictitious-zoo.com/birds/barnowl" title="Barn Owl"/>
    21     <html:p id="http://www.some-fictitious-zoo.com/birds/raven" title="Raven"/>
    22     <html:p step="2" id="http://www.some-fictitious-zoo.com/birds/archaeopteryx" title="Archaeopteryx"/>
    23     <html:p step="1" id="http://www.some-fictitious-zoo.com/birds/emperorpenguin" title="Emperor Penguin"/>
    24   </data>
    26 <script src="templates_shared.js"/>
    28 <script>
    29 <![CDATA[
    30 SimpleTest.waitForExplicitFinish();
    32 var testid ="html element - simple syntax";
    33 var queryType = "rdf";
    34 var isTreeBuilder = false;
    35 var needsOpen = false;
    36 var notWorkingYet = false;
    37 var notWorkingYetDynamic = false;
    38 var expectedOutput = document.getElementById("output");
    40 var changes = [
    41   // step 1
    42   function(targetds, root) {
    43     var newnode = RDF.GetResource(ZOO_NS + 'birds/emperorpenguin');
    44     targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'),
    45                     RDF.GetLiteral('Emperor Penguin'), true);
    46     var container = ContainerUtils.MakeSeq(targetds,
    47                       RDF.GetResource(ZOO_NS + 'birds'));
    48     container.AppendElement(newnode);
    49   },
    50   // step 2
    51   function(targetds, root) {
    52     var newnode = RDF.GetResource(ZOO_NS + 'birds/archaeopteryx');
    53     targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'),
    54                     RDF.GetLiteral('Archaeopteryx'), true);
    55     var container = ContainerUtils.MakeSeq(targetds,
    56                       RDF.GetResource(ZOO_NS + 'birds'));
    57     container.InsertElementAt(newnode, '4', true);
    58   },
    59   // step 3
    60   function(targetds, root) {
    61     var newnode = RDF.GetResource(ZOO_NS + 'birds/wren');
    62     targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'),
    63                     RDF.GetLiteral('Wren'), true);
    64     var container = ContainerUtils.MakeSeq(targetds,
    65                       RDF.GetResource(ZOO_NS + 'birds'));
    66     container.InsertElementAt(newnode, '1', true);
    67   },
    68   // step 4
    69   function(targetds, root) {
    70     var container = ContainerUtils.MakeSeq(targetds,
    71                       RDF.GetResource(ZOO_NS + 'birds'));
    72     var removednode = container.RemoveElementAt('3', true);
    73     targetds.Unassert(removednode, RDF.GetResource(ZOO_NS + 'rdf#name'),
    74                       RDF.GetLiteral('Barn Owl'), true);
    75   }
    76 ];
    77 ]]>
    78 </script>
    80 <div xmlns="http://www.w3.org/1999/xhtml" id="root" datasources="rdf:null" ref="http://www.some-fictitious-zoo.com/birds"><template xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><p xmlns="http://www.w3.org/1999/xhtml" uri="rdf:*" title="rdf:http://www.some-fictitious-zoo.com/rdf#name"/></template></div>
    81 </window>

mercurial