dom/tests/mochitest/bugs/test_bug335976.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=335976
michael@0 4 -->
michael@0 5 <head>
michael@0 6 <title>Test for Bug 335976</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 </head>
michael@0 10 <body>
michael@0 11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=335976">Mozilla Bug 335976</a>
michael@0 12 <p id="display"></p>
michael@0 13
michael@0 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>
michael@0 15
michael@0 16 <div id="rootish" style="background: yellow">
michael@0 17 <div>
michael@0 18 <textbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
michael@0 19 </div>
michael@0 20 </div>
michael@0 21
michael@0 22
michael@0 23 <div id="content" style="display: none">
michael@0 24
michael@0 25 </div>
michael@0 26 <pre id="test">
michael@0 27 <script class="testbody" type="text/javascript">
michael@0 28 <![CDATA[
michael@0 29
michael@0 30 function lookAtTextboxesIn(root, numExpected)
michael@0 31 {
michael@0 32 var textboxes = root.getElementsByTagName("textbox");
michael@0 33 var threw;
michael@0 34 var i;
michael@0 35 var n;
michael@0 36
michael@0 37 for (i = 0; n = textboxes[i]; ++i) {
michael@0 38 threw = true;
michael@0 39 try { n.nodeType; threw = false; } catch(e) { }
michael@0 40 ok(!threw, "n.nodeType threw");
michael@0 41 }
michael@0 42
michael@0 43 ok(textboxes.length == numExpected, "Wrong number of textboxes");
michael@0 44 }
michael@0 45
michael@0 46 function init()
michael@0 47 {
michael@0 48 // Look at the textbox in the yellow div.
michael@0 49 lookAtTextboxesIn(document.getElementById('rootish'), 1);
michael@0 50
michael@0 51 // Move the yellow div into the iframe.
michael@0 52 var nd = window.frames[0].document;
michael@0 53 nd.body.appendChild(nd.adoptNode(document.getElementById('rootish')));
michael@0 54
michael@0 55 // Look at the textboxes in the iframe.
michael@0 56 lookAtTextboxesIn(window.frames[0].document.body, 2);
michael@0 57
michael@0 58 SimpleTest.finish();
michael@0 59 }
michael@0 60
michael@0 61 SimpleTest.waitForExplicitFinish();
michael@0 62 addLoadEvent(init);
michael@0 63
michael@0 64 ]]>
michael@0 65 </script>
michael@0 66 </pre>
michael@0 67 </body>
michael@0 68 </html>

mercurial