summaryrefslogtreecommitdiffstats
path: root/dom/xul/templates/tests/chrome/test_bug330010.xul
blob: 67cc81931344d97522455067d72a0d0028124b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        xmlns:svg="http://www.w3.org/2000/svg"
        xmlns:html="http://www.w3.org/1999/xhtml"
        onload="boom();">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="text/javascript">
<![CDATA[

SimpleTest.waitForExplicitFinish();
function boom()
{
  const RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].
                         getService(Components.interfaces.nsIRDFService);
  var src = window.location.href.replace(/test_bug330010.xul/, "file_bug330010.rdf");

  var ds = RDF.GetDataSourceBlocking(src);

  var s = document.getElementById("s");
  s.setAttribute("datasources", "file_bug330010.rdf");

  var x = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "hbox");
  var generatedShape = s.childNodes[3];
  generatedShape.appendChild(x);
  document.documentElement.removeChild(document.getElementById("s"));
  ok(true, "Didn't crash");
  SimpleTest.finish();
}

]]>
</script>

  <html:div datasources="rdf:null" ref="urn:root" flex="1" id="s">
    <template>
      <rule>
        <conditions>
          <content uri="?root"/>
          <triple subject="?root"
                  predicate="urn:croczilla:xulsvg1:shapes"
                  object="?shapes"/>
          <member container="?shapes" child="?shape" id="m"/>
        </conditions>
        <action>
          <hbox id="p" uri="?shape" />
       </action>
     </rule>
   </template>
 </html:div>
</window>