content/base/test/test_bug330925.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=330925
     4 -->
     5 <head>
     6   <title>Test for Bug 330925</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 <style type="text/css">
    11 #t {
    12 -moz-binding: url(#randomxbl);
    13 }
    14 </style>
    16 <bindings xmlns="http://www.mozilla.org/xbl">
    17 <binding id="randomxbl" inheritstyle="false">
    18 <content>
    19 xbl textnode1
    20 <div>
    21 xbl textnode2
    22 <children xmlns="http://www.mozilla.org/xbl"/>
    23 </div>
    24 </content>
    25 </binding>
    26 </bindings>
    28 </head>
    29 <body>
    30 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=330925">Mozilla Bug 330925</a>
    32 <p id="display">
    33 <div id="t" />
    34 </p>
    36 <pre id="test">
    37 <script class="testbody" type="text/javascript">
    38 <![CDATA[
    40 /** Test for Bug 330925 **/
    42 // We have to wait until onload because XBL doesn't bind immediately.
    43 SimpleTest.waitForExplicitFinish();
    44 addLoadEvent(init);
    46 function init()
    47 {
    48   var t = document.getElementById("t");
    49   var d = SpecialPowers.wrap(document);
    51   is(SpecialPowers.unwrap(d.getBindingParent(d.getAnonymousNodes(t)[0])),
    52      t,
    53      "Wrong binding parent for anonymous node");
    55   is(SpecialPowers.unwrap(d.getBindingParent(d.getAnonymousNodes(t)[1].childNodes[0])),
    56      t,
    57      "Wrong binding parent for child of anonymous node");
    59   is(d.getBindingParent(t), 
    60      null,
    61      "Non-anonymous node should not have a binding parent");
    63   is(d.getBindingParent(document.documentElement), 
    64      null,
    65      "Document element should not have a binding parent");
    67   SimpleTest.finish();
    68 }
    70 ]]>
    71 </script>
    72 </pre>
    73 </body>
    74 </html>

mercurial