content/xul/templates/tests/chrome/test_tmpl_containmentattribute.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/xul/templates/tests/chrome/test_tmpl_containmentattribute.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     1.7 +
     1.8 +<!--
     1.9 +  containment attribute
    1.10 +-->
    1.11 +
    1.12 +<window title="XUL Template Tests" width="500" height="600"
    1.13 +        onload="test_template();"
    1.14 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.15 +  <script type="application/javascript"
    1.16 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.17 +
    1.18 +  <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
    1.19 +
    1.20 +  <data id="output" unordered="true">
    1.21 +    <checkbox step="-1" id="http://www.some-fictitious-zoo.com/arachnids/tarantula" label="Tarantula"/>
    1.22 +    <checkbox step="2" id="http://www.some-fictitious-zoo.com/mammals/lion" label="Lion"/>
    1.23 +    <checkbox id="http://www.some-fictitious-zoo.com/reptiles/anaconda" label="Anaconda"/>
    1.24 +    <checkbox id="http://www.some-fictitious-zoo.com/reptiles/chameleon" label="Chameleon"/>
    1.25 +    <checkbox id="http://www.some-fictitious-zoo.com/mammals/africanelephant" label="African Elephant"/>
    1.26 +  </data>
    1.27 +
    1.28 +<script src="templates_shared.js"/>
    1.29 +
    1.30 +<script>
    1.31 +<![CDATA[
    1.32 +SimpleTest.waitForExplicitFinish();
    1.33 +
    1.34 +var testid ="containment attribute";
    1.35 +var queryType = "rdf";
    1.36 +var isTreeBuilder = false;
    1.37 +var needsOpen = false;
    1.38 +var notWorkingYet = false;
    1.39 +var notWorkingYetDynamic = false;
    1.40 +var expectedOutput = document.getElementById("output");
    1.41 +
    1.42 +var changes = [
    1.43 +  // step 1
    1.44 +  function(targetds, root) {
    1.45 +    targetds.Unassert(RDF.GetResource(ZOO_NS + 'humans/robert'),
    1.46 +                      RDF.GetResource(ZOO_NS + 'rdf#favoriteAnimal'),
    1.47 +                      RDF.GetResource(ZOO_NS + 'arachnids/tarantula'), true);
    1.48 +  },
    1.49 +  // step 2
    1.50 +  function(targetds, root) {
    1.51 +    targetds.Assert(RDF.GetResource(ZOO_NS + 'humans/robert'),
    1.52 +                    RDF.GetResource(ZOO_NS + 'rdf#favoriteAnimal'),
    1.53 +                    RDF.GetResource(ZOO_NS + 'mammals/lion'), true);
    1.54 +  }
    1.55 +];
    1.56 +]]>
    1.57 +</script>
    1.58 +
    1.59 +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="rdf:null" ref="http://www.some-fictitious-zoo.com/humans/robert" containment="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal">
    1.60 +<template id="template">
    1.61 +<rule id="rule">
    1.62 +<conditions>
    1.63 +<content uri="?uri"/>
    1.64 +<member container="?uri" child="?child"/>
    1.65 +<triple subject="?child" predicate="http://www.some-fictitious-zoo.com/rdf#name" object="?name"/>
    1.66 +</conditions>
    1.67 +<action>
    1.68 +<checkbox uri="?child" label="?name"/>
    1.69 +</action>
    1.70 +</rule>
    1.71 +</template>
    1.72 +</vbox>
    1.73 +
    1.74 +</window>

mercurial