Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=895974 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <meta charset="utf-8"> |
michael@0 | 8 | <title>Test for Bug 895974</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <script type="application/javascript"> |
michael@0 | 12 | |
michael@0 | 13 | /** Test for Bug 895974 **/ |
michael@0 | 14 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 15 | |
michael@0 | 16 | addLoadEvent(function() { |
michael@0 | 17 | var frag = document.createDocumentFragment(); |
michael@0 | 18 | var span = document.createElement("span"); |
michael@0 | 19 | var div = document.createElement("div"); |
michael@0 | 20 | var text = document.createTextNode("help"); |
michael@0 | 21 | frag.appendChild(document.createTextNode("fail")); |
michael@0 | 22 | frag.appendChild(span); |
michael@0 | 23 | frag.appendChild(text); |
michael@0 | 24 | frag.appendChild(div); |
michael@0 | 25 | frag.appendChild(document.createTextNode("fail")); |
michael@0 | 26 | |
michael@0 | 27 | is(text.nextElementSibling, div, "nextElementSibling should work on text"); |
michael@0 | 28 | is(text.previousElementSibling, span, |
michael@0 | 29 | "previousElementSibling should work on text"); |
michael@0 | 30 | |
michael@0 | 31 | is(document.firstElementChild, document.documentElement, |
michael@0 | 32 | "firstElementChild should work on document"); |
michael@0 | 33 | is(document.lastElementChild, document.documentElement, |
michael@0 | 34 | "lastElementChild should work on document"); |
michael@0 | 35 | is(document.children.length, 1, "Document has one element kid"); |
michael@0 | 36 | is(document.children[0], document.documentElement, |
michael@0 | 37 | "Document only element child is <html>"); |
michael@0 | 38 | |
michael@0 | 39 | is(frag.firstElementChild, span, |
michael@0 | 40 | "firstElementChild should work on document fragment"); |
michael@0 | 41 | is(frag.lastElementChild, div, |
michael@0 | 42 | "lastElementChild should work on document fragment"); |
michael@0 | 43 | is(frag.children.length, 2, "Document fragment has two element kids"); |
michael@0 | 44 | is(frag.children[0], span, "Document fragment first element child is span"); |
michael@0 | 45 | is(frag.children[1], div, "Document fragment second element child is div"); |
michael@0 | 46 | |
michael@0 | 47 | is(document.documentElement.firstElementChild, document.head, |
michael@0 | 48 | "firstElementChild should work on element"); |
michael@0 | 49 | is(document.documentElement.lastElementChild, document.body, |
michael@0 | 50 | "lastElementChild should work on element"); |
michael@0 | 51 | is(document.documentElement.children.length, 2, "<html> has two element kids"); |
michael@0 | 52 | is(document.documentElement.children[0], document.head, |
michael@0 | 53 | "<html> first element child is head"); |
michael@0 | 54 | is(document.documentElement.children[1], document.body, |
michael@0 | 55 | "<html> second element child is body"); |
michael@0 | 56 | SimpleTest.finish(); |
michael@0 | 57 | }); |
michael@0 | 58 | </script> |
michael@0 | 59 | </head> |
michael@0 | 60 | <body> |
michael@0 | 61 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=895974">Mozilla Bug 895974</a> |
michael@0 | 62 | <p id="display"></p> |
michael@0 | 63 | <div id="content" style="display: none"> |
michael@0 | 64 | |
michael@0 | 65 | </div> |
michael@0 | 66 | <pre id="test"> |
michael@0 | 67 | </pre> |
michael@0 | 68 | </body> |
michael@0 | 69 | </html> |