author Honza Bambas <>
Thu, 21 May 2009 00:27:31 +0200
changeset 28676 f1c65acaccf363aa6d073ef5b958320071848e38
parent 13696 7884f8383ed0d1525a3d641b0d7999d2adb3d07b
child 71371 a6f07adca5d5f740fb40d7c08f65980416d67cd1
permissions -rw-r--r--
Bug 455070 - Make sessionStorage object conform the WHATWG spec, r+sr=jst

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
<window title="Mozilla Bug 398492"
  <script type="application/javascript" src="/MochiKit/packed.js" />
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
  <bindings xmlns="">
    <binding id="test">
        <xul:hbox id="xxx"

  <!-- test results are displayed in the html:body -->
  <body xmlns="">
  <a href=""
     target="_blank">Mozilla Bug 398492</a>

  <hbox id="testbox" style="-moz-binding: url(#test)">Text</hbox>
  <!-- test code goes here -->
  <script type="application/javascript"><![CDATA[

    /** Test for Bug 398492 **/

    function getXBLParent(node) {"UniversalXPConnect");
      var utils = Components.classes[";1"]
      return utils.getParentForNode(node, true);

    addLoadEvent(function() {
      var n = $("testbox");
      var kid = n.firstChild;
      var anonKid = document.getAnonymousNodes(n)[0];
      is(anonKid instanceof XULElement, true, "Must be a XUL element");
      is(anonKid, getXBLParent(kid), "Unexpected anonymous nodes");

      var n2 = n.cloneNode(true);
      var kid2 = n2.firstChild;
      var anonKid2 = document.getAnonymousNodes(n2)[0];
      is(anonKid2 instanceof XULElement, true,
         "Must be a XUL element after clone");
      is(anonKid2, getXBLParent(kid2),
         "Unexpected anonymous nodes after clone");

      var n3 = document.createElement("hbox");
      var kid3 = document.createTextNode("Text");
      document.addBinding(n3, document.location.href + "#test");
      var anonKid3 = document.getAnonymousNodes(n3)[0];
      is(anonKid3 instanceof XULElement, true,
         "Must be a XUL element after addBinding");
      is(anonKid3, getXBLParent(kid3),
         "Unexpected anonymous nodes after addBinding");

      isnot(anonKid, getXBLParent(kid),
            "Should have removed kid from insertion point");

      isnot(anonKid2, getXBLParent(kid2),
            "Should have removed kid2 from insertion point");
      isnot(anonKid3, getXBLParent(kid3),
            "Should have removed kid3 from insertion point");