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