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 | --> |
michael@0 | 5 | <head> |
michael@0 | 6 | <title>W3 Tests for Element Traversal - HTML</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 | |
michael@0 | 12 | <p id="parentEl_count"> |
michael@0 | 13 | <span id="first_element_child_count"> |
michael@0 | 14 | <span></span> |
michael@0 | 15 | <span></span> |
michael@0 | 16 | </span> |
michael@0 | 17 | <span id="middle_element_child_count"></span> |
michael@0 | 18 | <span id="last_element_child_count"></span> |
michael@0 | 19 | </p> |
michael@0 | 20 | |
michael@0 | 21 | |
michael@0 | 22 | <p id="parentEl_nochild"> |
michael@0 | 23 | </p> |
michael@0 | 24 | |
michael@0 | 25 | <p id="parentEl_null"> |
michael@0 | 26 | </p> |
michael@0 | 27 | |
michael@0 | 28 | <p id="parentEl_dynamicadd"> |
michael@0 | 29 | <span id="first_emement_child_add"></span> |
michael@0 | 30 | </p> |
michael@0 | 31 | |
michael@0 | 32 | <p id="parentEl_dynamicremove"> |
michael@0 | 33 | <span id="first_emement_child_remove"></span> |
michael@0 | 34 | <span id="last_emement_child_remove"></span> |
michael@0 | 35 | </p> |
michael@0 | 36 | |
michael@0 | 37 | |
michael@0 | 38 | <p id="parentEl_fec"> |
michael@0 | 39 | <span id="first_element_child_fec"></span> |
michael@0 | 40 | </p> |
michael@0 | 41 | |
michael@0 | 42 | <p id="parentEl_lec"> |
michael@0 | 43 | <span id="first_element_child_lec"></span> |
michael@0 | 44 | <span id="last_element_child_lec"></span> |
michael@0 | 45 | </p> |
michael@0 | 46 | |
michael@0 | 47 | <p id="parentEl_namespace"> |
michael@0 | 48 | <pickle:span id="first_element_child_namespace"></pickle:span> |
michael@0 | 49 | </p> |
michael@0 | 50 | |
michael@0 | 51 | <p id="parentEl_nes"> |
michael@0 | 52 | <span id="first_element_child_nes"></span> |
michael@0 | 53 | <span id="last_element_child_nes"></span> |
michael@0 | 54 | </p> |
michael@0 | 55 | |
michael@0 | 56 | <p id="parentEl_pes"> |
michael@0 | 57 | <span id="first_element_child_pes"></span> |
michael@0 | 58 | <span id="middle_element_child_pes"></span> |
michael@0 | 59 | <span id="last_element_child_pes"></span> |
michael@0 | 60 | </p> |
michael@0 | 61 | |
michael@0 | 62 | <p id="parentEl_sibnull"> |
michael@0 | 63 | <span id="first_element_child_sibnull"></span> |
michael@0 | 64 | </p> |
michael@0 | 65 | |
michael@0 | 66 | <pre id="test"> |
michael@0 | 67 | <script class="testbody" type="text/javascript"> |
michael@0 | 68 | |
michael@0 | 69 | |
michael@0 | 70 | |
michael@0 | 71 | function runTest() { |
michael@0 | 72 | |
michael@0 | 73 | //from et-childElementCount.html |
michael@0 | 74 | var parentEl = document.getElementById("parentEl_count"); |
michael@0 | 75 | is(parentEl.childElementCount && 3, parentEl.childElementCount, "Child Element Count is mismatched"); |
michael@0 | 76 | |
michael@0 | 77 | //from et-childElementCount-nochild.html |
michael@0 | 78 | var parentEl_nochild = document.getElementById("parentEl_nochild"); |
michael@0 | 79 | is(parentEl_nochild.childElementCount, 0, "Child Element count is not 0"); |
michael@0 | 80 | |
michael@0 | 81 | //from et-childElementCount-null.html |
michael@0 | 82 | parentEl = document.getElementById("parentEl_null"); |
michael@0 | 83 | is(null == parentEl.firstElementChild, null == parentEl.lastElementChild, "firstElementChild or lastElementChild is not null"); |
michael@0 | 84 | |
michael@0 | 85 | //from et-dynamic-add.html |
michael@0 | 86 | parentEl = document.getElementById("parentEl_dynamicadd"); |
michael@0 | 87 | var newChild = document.createElement("span") |
michael@0 | 88 | parentEl.appendChild( newChild ); |
michael@0 | 89 | is(parentEl.childElementCount && 2, parentEl.childElementCount, "failed to add span element"); |
michael@0 | 90 | |
michael@0 | 91 | //from et-dynamic-remove.html |
michael@0 | 92 | parentEl = document.getElementById("parentEl_dynamicremove"); |
michael@0 | 93 | var lec = parentEl.lastElementChild; |
michael@0 | 94 | parentEl.removeChild( lec ); |
michael@0 | 95 | is(parentEl.childElementCount && 1, parentEl.childElementCount, "failed to remove span element"); |
michael@0 | 96 | |
michael@0 | 97 | //from et-firstElementChild.html |
michael@0 | 98 | parentEl = document.getElementById("parentEl_fec"); |
michael@0 | 99 | var fec = parentEl.firstElementChild; |
michael@0 | 100 | is(fec.nodeType, 1, "failed to get firstElementChild"); |
michael@0 | 101 | is(fec.getAttribute("id"), "first_element_child_fec", "failed to get firstElementChild"); |
michael@0 | 102 | isnot(fec, null, "failed to get firstElementChild"); |
michael@0 | 103 | |
michael@0 | 104 | //from et-lastElementChild.html |
michael@0 | 105 | parentEl = document.getElementById("parentEl_lec"); |
michael@0 | 106 | var lec = parentEl.lastElementChild; |
michael@0 | 107 | is(lec.nodeType, 1, "failed to get lastElementChild"); |
michael@0 | 108 | is(lec.getAttribute("id"), "last_element_child_lec", "failed to get lastElementChild"); |
michael@0 | 109 | isnot(lec, null, "failed to get lastElementChild"); |
michael@0 | 110 | |
michael@0 | 111 | //from et-namespace.html |
michael@0 | 112 | parentEl = document.getElementById("parentEl_namespace"); |
michael@0 | 113 | var fec = parentEl.firstElementChild; |
michael@0 | 114 | isnot(fec, null, "failed to get firstElementChild in namespace"); |
michael@0 | 115 | is(fec.getAttribute("id"), "first_element_child_namespace", "failed to get firstElementChild in namespace"); |
michael@0 | 116 | |
michael@0 | 117 | //from et-nextElementSibling.html |
michael@0 | 118 | parentEl = document.getElementById("parentEl_nes"); |
michael@0 | 119 | var fec = parentEl.firstElementChild; |
michael@0 | 120 | var nes = fec.nextElementSibling; |
michael@0 | 121 | is(nes.nodeType, 1, "failed to get nextElementSibling"); |
michael@0 | 122 | is(nes.getAttribute("id"), "last_element_child_nes", "failed to get nextElementSibling"); |
michael@0 | 123 | isnot(nes, null, "failed to get nextElementSibling"); |
michael@0 | 124 | |
michael@0 | 125 | //from et-previousElementSibling.html |
michael@0 | 126 | var lec = document.getElementById("last_element_child_pes"); |
michael@0 | 127 | var pes = lec.previousElementSibling; |
michael@0 | 128 | is(pes.nodeType, 1, "failed to get previousElementSibling"); |
michael@0 | 129 | is(pes.getAttribute("id"), "middle_element_child_pes", "failed to get previousElementSibling"); |
michael@0 | 130 | isnot(pes, null, "failed to get previousElementSibling"); |
michael@0 | 131 | |
michael@0 | 132 | //from et-siblingElement-null.html |
michael@0 | 133 | var fec = document.getElementById("first_element_child_sibnull"); |
michael@0 | 134 | var pes = fec.previousElementSibling; |
michael@0 | 135 | var nes = fec.nextElementSibling; |
michael@0 | 136 | is(pes, null, "got unexpected previousElementSibling"); |
michael@0 | 137 | is(nes, null, "got unexpected nextElementSibling"); |
michael@0 | 138 | |
michael@0 | 139 | } |
michael@0 | 140 | |
michael@0 | 141 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 142 | addLoadEvent(runTest); |
michael@0 | 143 | addLoadEvent(SimpleTest.finish) |
michael@0 | 144 | </script> |
michael@0 | 145 | </pre> |
michael@0 | 146 | </body> |
michael@0 | 147 | </html> |
michael@0 | 148 |