dom/tests/mochitest/bugs/test_bug335976.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=335976
     4 -->
     5 <head>
     6   <title>Test for Bug 335976</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=335976">Mozilla Bug 335976</a>
    12 <p id="display"></p>
    14 <iframe src="data:application/xhtml+xml,&lt;html xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;body&gt; &lt;textbox xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'/&gt; &lt;/body&gt;&lt;/html&gt;" style="width: 95%; height: 150px;"></iframe>
    16 <div id="rootish" style="background: yellow">
    17   <div>
    18     <textbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
    19   </div>
    20 </div>
    23 <div id="content" style="display: none">
    25 </div>
    26 <pre id="test">
    27 <script class="testbody" type="text/javascript">
    28 <![CDATA[
    30 function lookAtTextboxesIn(root, numExpected) 
    31 {
    32   var textboxes = root.getElementsByTagName("textbox");
    33   var threw;
    34   var i;
    35   var n;
    37   for (i = 0; n = textboxes[i]; ++i) {
    38     threw = true;
    39     try { n.nodeType; threw = false; } catch(e) { }
    40     ok(!threw, "n.nodeType threw");
    41   }
    43   ok(textboxes.length == numExpected, "Wrong number of textboxes");
    44 }
    46 function init()
    47 {
    48   // Look at the textbox in the yellow div.
    49   lookAtTextboxesIn(document.getElementById('rootish'), 1);
    51   // Move the yellow div into the iframe.
    52   var nd = window.frames[0].document; 
    53   nd.body.appendChild(nd.adoptNode(document.getElementById('rootish')));
    55   // Look at the textboxes in the iframe.
    56   lookAtTextboxesIn(window.frames[0].document.body, 2);
    58   SimpleTest.finish();
    59 }
    61 SimpleTest.waitForExplicitFinish();
    62 addLoadEvent(init);
    64 ]]>
    65 </script>
    66 </pre>
    67 </body>
    68 </html>

mercurial