dom/xbl/test/test_bug378866.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/test/test_bug378866.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=378866
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 378866</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +  <bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
    1.14 +    <binding id="b1">
    1.15 +      <content><html:span><html:span>
    1.16 +        <children/>
    1.17 +      </html:span></html:span></content>
    1.18 +  </binding>
    1.19 +</bindings>
    1.20 +
    1.21 +</head>
    1.22 +<body>
    1.23 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=378866">Mozilla Bug 378866</a>
    1.24 +<p id="display"></p>
    1.25 +<div id="content">
    1.26 +  <span id="grandparent" style="-moz-binding: url(#b1);">
    1.27 +    <span id="parent">
    1.28 +      <span id="child"/>
    1.29 +    </span>
    1.30 +  </span>
    1.31 +</div>
    1.32 +<pre id="test">
    1.33 +<script class="testbody" type="text/javascript">
    1.34 +<![CDATA[
    1.35 +
    1.36 +/** Test for Bug 378866 **/
    1.37 +
    1.38 +function runTest() {
    1.39 +  var anon = SpecialPowers.wrap(document).getAnonymousNodes(document.getElementById('grandparent'));
    1.40 +  var child = SpecialPowers.wrap(document).getElementById('child');
    1.41 +  var insertionPoint = anon[0].childNodes[0];
    1.42 +  insertionPoint.parentNode.removeChild(insertionPoint);
    1.43 +  child.appendChild(insertionPoint);
    1.44 +
    1.45 +  var e = document.createEvent("Event");
    1.46 +  e.initEvent("foo", true, true);
    1.47 +  child.dispatchEvent(e);
    1.48 +  ok(true, "Moving insertion point shouldn't cause problems in event dispatching");
    1.49 +  addLoadEvent(SimpleTest.finish);
    1.50 +}
    1.51 +
    1.52 +SimpleTest.waitForExplicitFinish();
    1.53 +addLoadEvent(runTest);
    1.54 +
    1.55 +]]>
    1.56 +</script>
    1.57 +</pre>
    1.58 +</body>
    1.59 +</html>
    1.60 +

mercurial