content/base/test/test_bug338541.xhtml

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=338541
     4 -->
     5 <head>
     6   <title>Test for Bug 338541</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     9 </head>
    10 <body>
    11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=338541">Mozilla Bug 338541</a>
    12 <p id="display"></p>
    13 <pre id="test">
    14 <script class="testbody" type="text/javascript">
    16 /** Test for Bug 338541 **/
    17 function getName(aNode, f)
    18 {
    19   return (aNode ? aNode.nodeName : "(null)");
    20 }
    22 function walkDOM()
    23 {
    24   var walker = document.createTreeWalker($('content'), NodeFilter.SHOW_ELEMENT, null);
    25   var output = "";
    26   while (walker.nextNode())
    27   {
    28     output += getName(walker.currentNode) + "\n";
    29   }
    30   output += "Final currentNode: " + getName(walker.currentNode);
    31   is(output, "foo\nbar\nhtml:b\nqux\nbaz\nFinal currentNode: baz","treewalker returns correct nodeName");
    32   SimpleTest.finish();
    33 }
    35 SimpleTest.waitForExplicitFinish();
    36 addLoadEvent(walkDOM, ok);
    38 </script>
    39 </pre>
    40 <div id="content" style="display: none">
    41   <foo xmlns="http://example.com">
    42      <bar><html:b xmlns:html="http://www.w3.org/1999/xhtml"><qux/></html:b>
    43        <baz/>
    44      </bar>
    45   </foo>
    46 </div>
    47 </body>
    48 </html>

mercurial