dom/tests/mochitest/whatwg/test_document_scripts.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=685774
     5 -->
     6 <head>
     7   <title>Test for document.scripts (Bug 685774)</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685774">Mozilla Bug 685774</a>
    14 <script type="application/javascript">
    16 /** Test for Bug 685774 **/
    18 function testSameCollection(a, b, c) {
    19   is(a.length, c, "unexpected count of script elements");
    20   is(b.length, c, "unexpected count of script elements");
    21   for (var i = 0; i < a.length; i++) {
    22     is(a[i], b[i], "document.scripts is not supported");
    23   }
    24 }
    26 SimpleTest.waitForExplicitFinish();
    28 testSameCollection(document.scripts, document.getElementsByTagName("script"), 3);
    30 </script>
    31 <script type="application/javascript">
    33 testSameCollection(document.scripts, document.getElementsByTagName("script"), 4);
    35 function start() {
    36   testSameCollection(document.scripts, document.getElementsByTagName("script"), 5);
    38   var e = document.createElement("script");
    39   testSameCollection(document.scripts, document.getElementsByTagName("script"), 5);
    40   document.body.appendChild(e);
    41   testSameCollection(document.scripts, document.getElementsByTagName("script"), 6);
    43   SimpleTest.finish();
    44 }
    46 addLoadEvent(start);
    48 </script>
    49 <script type="application/javascript">
    51 testSameCollection(document.scripts, document.getElementsByTagName("script"), 5);
    53 </script>
    54 </body>
    55 </html>

mercurial