layout/style/test/test_bug667520.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=667520
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 667520</title>
michael@0 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 10 </head>
michael@0 11 <body>
michael@0 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=667520">Mozilla Bug 667520</a>
michael@0 13 <p id="display">
michael@0 14 <!-- important: we need a <span> as the second element child and then
michael@0 15 non-span elements between that and the next </span> -->
michael@0 16 <i></i>
michael@0 17 <span id="2"></span>
michael@0 18 <i></i>
michael@0 19 <i></i>
michael@0 20 <i></i>
michael@0 21 <i></i>
michael@0 22 <span id="7"></span>
michael@0 23 <span id="8"></span>
michael@0 24 </p>
michael@0 25 <div id="content" style="display: none">
michael@0 26
michael@0 27 </div>
michael@0 28 <pre id="test">
michael@0 29 <script type="application/javascript">
michael@0 30
michael@0 31 /** Test for Bug 667520 **/
michael@0 32 var spans = $("display").querySelectorAll("span");
michael@0 33 is(spans.length, 3, "Should have 3 span kids");
michael@0 34
michael@0 35 is($("display").querySelector("span:nth-child(3)"), null, "Third child is not span");
michael@0 36 is($("display").querySelector("span:nth-child(4)"), null, "Fourth child is not span");
michael@0 37
michael@0 38 for (var i = 0; i < spans.length; ++i) {
michael@0 39 var id = spans[i].id;
michael@0 40 /* Important: need to include 'span' in that selector so we only match
michael@0 41 nth-child against spans. */
michael@0 42 var target = $("display").querySelector("span:nth-child("+id+")");
michael@0 43 is(target, spans[i], "Unexpected element");
michael@0 44 is(target.id, spans[i].id, "Unexpected id");
michael@0 45 }
michael@0 46
michael@0 47 </script>
michael@0 48 </pre>
michael@0 49 </body>
michael@0 50 </html>

mercurial