content/base/test/test_bug330925.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial