Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | function run_test() |
michael@0 | 3 | { |
michael@0 | 4 | |
michael@0 | 5 | /** |
michael@0 | 6 | * NOTE: [i] is not allowed in this test, since it's done via classinfo and |
michael@0 | 7 | * we don't have that in xpcshell. |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | test_getElementsByTagName(); |
michael@0 | 11 | test_getElementsByTagNameNS(); |
michael@0 | 12 | test_getElementsByAttribute(); |
michael@0 | 13 | test_getElementsByAttributeNS(); |
michael@0 | 14 | |
michael@0 | 15 | // What else should we test? |
michael@0 | 16 | // XXXbz we need more tests here to test liveness! |
michael@0 | 17 | |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | function test_getElementsByTagName() |
michael@0 | 21 | { |
michael@0 | 22 | var doc = ParseFile("nodelist_data_1.xml"); |
michael@0 | 23 | var root = doc.documentElement; |
michael@0 | 24 | |
michael@0 | 25 | // Check that getElementsByTagName returns a nodelist. |
michael@0 | 26 | do_check_true(doc.getElementsByTagName("*") instanceof nsIDOMNodeList); |
michael@0 | 27 | do_check_true(root.getElementsByTagName("*") instanceof nsIDOMNodeList); |
michael@0 | 28 | |
michael@0 | 29 | // Check that getElementsByTagName excludes the element it's called on. |
michael@0 | 30 | do_check_eq(doc.getElementsByTagName("*").length, |
michael@0 | 31 | root.getElementsByTagName("*").length + 1); |
michael@0 | 32 | do_check_eq(doc.getElementById("test2").getElementsByTagName("*").length, |
michael@0 | 33 | 8); |
michael@0 | 34 | do_check_eq(doc.getElementById("test2").getElementsByTagName("test").length, |
michael@0 | 35 | 3); |
michael@0 | 36 | |
michael@0 | 37 | // Check that the first element of getElementsByTagName on the document is |
michael@0 | 38 | // the right thing. |
michael@0 | 39 | do_check_eq(doc.getElementsByTagName("*").item(0), root); |
michael@0 | 40 | |
michael@0 | 41 | // Check that we get the right things in the right order |
michael@0 | 42 | var numTests = doc.getElementsByTagName("test").length; |
michael@0 | 43 | do_check_eq(numTests, 5); |
michael@0 | 44 | |
michael@0 | 45 | for (var i = 1; i <= numTests; ++i) { |
michael@0 | 46 | do_check_true(doc.getElementById("test" + i) instanceof nsIDOMElement); |
michael@0 | 47 | do_check_eq(doc.getElementById("test" + i), |
michael@0 | 48 | doc.getElementsByTagName("test").item(i-1)); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | // Check that we handle tagnames containing ':' correctly |
michael@0 | 52 | do_check_true(doc.getElementsByTagName("foo:test") |
michael@0 | 53 | instanceof nsIDOMNodeList); |
michael@0 | 54 | do_check_eq(doc.getElementsByTagName("foo:test").length, 2); |
michael@0 | 55 | |
michael@0 | 56 | do_check_true(doc.getElementsByTagName("foo2:test") |
michael@0 | 57 | instanceof nsIDOMNodeList); |
michael@0 | 58 | do_check_eq(doc.getElementsByTagName("foo2:test").length, 3); |
michael@0 | 59 | |
michael@0 | 60 | do_check_true(doc.getElementsByTagName("bar:test") |
michael@0 | 61 | instanceof nsIDOMNodeList); |
michael@0 | 62 | do_check_eq(doc.getElementsByTagName("bar:test").length, 4); |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | function test_getElementsByTagNameNS() |
michael@0 | 66 | { |
michael@0 | 67 | var doc = ParseFile("nodelist_data_1.xml"); |
michael@0 | 68 | var root = doc.documentElement; |
michael@0 | 69 | |
michael@0 | 70 | // Check that getElementsByTagNameNS returns a nodelist. |
michael@0 | 71 | do_check_true(doc.getElementsByTagNameNS("*", "*") instanceof nsIDOMNodeList); |
michael@0 | 72 | do_check_true(root.getElementsByTagNameNS("*", "*") instanceof nsIDOMNodeList); |
michael@0 | 73 | |
michael@0 | 74 | // Check that passing "" and null for the namespace URI gives the same result |
michael@0 | 75 | var list1 = doc.getElementsByTagNameNS("", "test"); |
michael@0 | 76 | var list2 = doc.getElementsByTagNameNS(null, "test"); |
michael@0 | 77 | do_check_eq(list1.length, list2.length); |
michael@0 | 78 | for (var i = 0; i < list1.length; ++i) { |
michael@0 | 79 | do_check_eq(list1.item(i), list2.item(i)); |
michael@0 | 80 | } |
michael@0 | 81 | |
michael@0 | 82 | // Check that getElementsByTagNameNS excludes the element it's called on. |
michael@0 | 83 | do_check_eq(doc.getElementsByTagNameNS("*", "*").length, |
michael@0 | 84 | root.getElementsByTagNameNS("*", "*").length + 1); |
michael@0 | 85 | do_check_eq(doc.getElementById("test2") |
michael@0 | 86 | .getElementsByTagNameNS("*", "*").length, |
michael@0 | 87 | 8); |
michael@0 | 88 | do_check_eq(doc.getElementById("test2") |
michael@0 | 89 | .getElementsByTagNameNS("", "test").length, |
michael@0 | 90 | 1); |
michael@0 | 91 | do_check_eq(doc.getElementById("test2") |
michael@0 | 92 | .getElementsByTagNameNS("*", "test").length, |
michael@0 | 93 | 7); |
michael@0 | 94 | |
michael@0 | 95 | // Check that the first element of getElementsByTagNameNS on the document is |
michael@0 | 96 | // the right thing. |
michael@0 | 97 | do_check_eq(doc.getElementsByTagNameNS("*", "*").item(0), root); |
michael@0 | 98 | do_check_eq(doc.getElementsByTagNameNS(null, "*").item(0), root); |
michael@0 | 99 | |
michael@0 | 100 | // Check that we get the right things in the right order |
michael@0 | 101 | |
michael@0 | 102 | |
michael@0 | 103 | var numTests = doc.getElementsByTagNameNS("*", "test").length; |
michael@0 | 104 | do_check_eq(numTests, 14); |
michael@0 | 105 | |
michael@0 | 106 | for (var i = 1; i <= numTests; ++i) { |
michael@0 | 107 | do_check_true(doc.getElementById("test" + i) instanceof nsIDOMElement); |
michael@0 | 108 | do_check_eq(doc.getElementById("test" + i), |
michael@0 | 109 | doc.getElementsByTagNameNS("*", "test").item(i-1)); |
michael@0 | 110 | } |
michael@0 | 111 | |
michael@0 | 112 | // Check general proper functioning of having a non-wildcard namespace. |
michael@0 | 113 | var test2 = doc.getElementById("test2"); |
michael@0 | 114 | do_check_eq(doc.getElementsByTagNameNS("", "test").length, |
michael@0 | 115 | 3); |
michael@0 | 116 | do_check_eq(test2.getElementsByTagNameNS("", "test").length, |
michael@0 | 117 | 1); |
michael@0 | 118 | do_check_eq(doc.getElementsByTagNameNS("foo", "test").length, |
michael@0 | 119 | 7); |
michael@0 | 120 | do_check_eq(test2.getElementsByTagNameNS("foo", "test").length, |
michael@0 | 121 | 4); |
michael@0 | 122 | do_check_eq(doc.getElementsByTagNameNS("foo2", "test").length, |
michael@0 | 123 | 0); |
michael@0 | 124 | do_check_eq(test2.getElementsByTagNameNS("foo2", "test").length, |
michael@0 | 125 | 0); |
michael@0 | 126 | do_check_eq(doc.getElementsByTagNameNS("bar", "test").length, |
michael@0 | 127 | 4); |
michael@0 | 128 | do_check_eq(test2.getElementsByTagNameNS("bar", "test").length, |
michael@0 | 129 | 2); |
michael@0 | 130 | |
michael@0 | 131 | // Check that we handle tagnames containing ':' correctly |
michael@0 | 132 | do_check_true(doc.getElementsByTagNameNS(null, "foo:test") |
michael@0 | 133 | instanceof nsIDOMNodeList); |
michael@0 | 134 | do_check_eq(doc.getElementsByTagNameNS(null, "foo:test").length, 0); |
michael@0 | 135 | do_check_eq(doc.getElementsByTagNameNS("foo", "foo:test").length, 0); |
michael@0 | 136 | do_check_eq(doc.getElementsByTagNameNS("bar", "foo:test").length, 0); |
michael@0 | 137 | do_check_eq(doc.getElementsByTagNameNS("*", "foo:test").length, 0); |
michael@0 | 138 | |
michael@0 | 139 | do_check_true(doc.getElementsByTagNameNS(null, "foo2:test") |
michael@0 | 140 | instanceof nsIDOMNodeList); |
michael@0 | 141 | do_check_eq(doc.getElementsByTagNameNS(null, "foo2:test").length, 0); |
michael@0 | 142 | do_check_eq(doc.getElementsByTagNameNS("foo2", "foo2:test").length, 0); |
michael@0 | 143 | do_check_eq(doc.getElementsByTagNameNS("bar", "foo2:test").length, 0); |
michael@0 | 144 | do_check_eq(doc.getElementsByTagNameNS("*", "foo2:test").length, 0); |
michael@0 | 145 | |
michael@0 | 146 | do_check_true(doc.getElementsByTagNameNS(null, "bar:test") |
michael@0 | 147 | instanceof nsIDOMNodeList); |
michael@0 | 148 | do_check_eq(doc.getElementsByTagNameNS(null, "bar:test").length, 0); |
michael@0 | 149 | do_check_eq(doc.getElementsByTagNameNS("bar", "bar:test").length, 0); |
michael@0 | 150 | do_check_eq(doc.getElementsByTagNameNS("*", "bar:test").length, 0); |
michael@0 | 151 | |
michael@0 | 152 | // Check that previously-unknown namespaces are handled right. Note that we |
michael@0 | 153 | // can just hardcode the strings, since we're running only once in XPCshell. |
michael@0 | 154 | // If someone wants to run these in a browser, some use of Math.random() may |
michael@0 | 155 | // be in order. |
michael@0 | 156 | list1 = doc.getElementsByTagNameNS("random-bogus-namespace", "foo"); |
michael@0 | 157 | list2 = doc.documentElement.getElementsByTagNameNS("random-bogus-namespace2", |
michael@0 | 158 | "foo"); |
michael@0 | 159 | do_check_neq(list1, list2); |
michael@0 | 160 | do_check_eq(list1.length, 0); |
michael@0 | 161 | do_check_eq(list2.length, 0); |
michael@0 | 162 | var newNode = doc.createElementNS("random-bogus-namespace", "foo"); |
michael@0 | 163 | doc.documentElement.appendChild(newNode); |
michael@0 | 164 | var newNode = doc.createElementNS("random-bogus-namespace2", "foo"); |
michael@0 | 165 | doc.documentElement.appendChild(newNode); |
michael@0 | 166 | do_check_eq(list1.length, 1); |
michael@0 | 167 | do_check_eq(list2.length, 1); |
michael@0 | 168 | } |
michael@0 | 169 | |
michael@0 | 170 | function test_getElementsByAttribute() |
michael@0 | 171 | { |
michael@0 | 172 | var doc = ParseFile("nodelist_data_2.xul"); |
michael@0 | 173 | var root = doc.documentElement; |
michael@0 | 174 | |
michael@0 | 175 | // Sadly, DOMParser can't create XULDocument objects. But at least we have a |
michael@0 | 176 | // XULElement! |
michael@0 | 177 | |
michael@0 | 178 | do_check_true(root instanceof nsIDOMXULElement); |
michael@0 | 179 | |
michael@0 | 180 | do_check_true(root.getElementsByAttribute("foo", "foo") instanceof |
michael@0 | 181 | nsIDOMNodeList); |
michael@0 | 182 | |
michael@0 | 183 | var master1 = doc.getElementById("master1"); |
michael@0 | 184 | var master2 = doc.getElementById("master2"); |
michael@0 | 185 | var master3 = doc.getElementById("master3"); |
michael@0 | 186 | var external = doc.getElementById("external"); |
michael@0 | 187 | |
michael@0 | 188 | do_check_true(master1 instanceof nsIDOMXULElement); |
michael@0 | 189 | do_check_true(master2 instanceof nsIDOMXULElement); |
michael@0 | 190 | do_check_true(master3 instanceof nsIDOMXULElement); |
michael@0 | 191 | do_check_true(external instanceof nsIDOMXULElement); |
michael@0 | 192 | |
michael@0 | 193 | // Basic tests |
michael@0 | 194 | do_check_eq(root.getElementsByAttribute("foo", "foo").length, |
michael@0 | 195 | 14); |
michael@0 | 196 | do_check_eq(master1.getElementsByAttribute("foo", "foo").length, |
michael@0 | 197 | 4); |
michael@0 | 198 | |
michael@0 | 199 | do_check_eq(root.getElementsByAttribute("foo", "bar").length, |
michael@0 | 200 | 7); |
michael@0 | 201 | do_check_eq(master1.getElementsByAttribute("foo", "bar").length, |
michael@0 | 202 | 2); |
michael@0 | 203 | |
michael@0 | 204 | do_check_eq(root.getElementsByAttribute("bar", "bar").length, |
michael@0 | 205 | 7); |
michael@0 | 206 | do_check_eq(master1.getElementsByAttribute("bar", "bar").length, |
michael@0 | 207 | 2); |
michael@0 | 208 | |
michael@0 | 209 | do_check_eq(root.getElementsByAttribute("foo", "*").length, |
michael@0 | 210 | 21); |
michael@0 | 211 | do_check_eq(master1.getElementsByAttribute("foo", "*").length, |
michael@0 | 212 | 6); |
michael@0 | 213 | |
michael@0 | 214 | // Test the various combinations of attributes with colons in the name |
michael@0 | 215 | do_check_eq(root.getElementsByAttribute("foo:foo", "foo").length, |
michael@0 | 216 | 16); |
michael@0 | 217 | do_check_eq(master1.getElementsByAttribute("foo:foo", "foo").length, |
michael@0 | 218 | 5); |
michael@0 | 219 | do_check_eq(master2.getElementsByAttribute("foo:foo", "foo").length, |
michael@0 | 220 | 4); |
michael@0 | 221 | do_check_eq(master3.getElementsByAttribute("foo:foo", "foo").length, |
michael@0 | 222 | 4); |
michael@0 | 223 | do_check_eq(external.getElementsByAttribute("foo:foo", "foo").length, |
michael@0 | 224 | 2); |
michael@0 | 225 | |
michael@0 | 226 | do_check_eq(root.getElementsByAttribute("foo:foo", "bar").length, |
michael@0 | 227 | 9); |
michael@0 | 228 | do_check_eq(master1.getElementsByAttribute("foo:foo", "bar").length, |
michael@0 | 229 | 2); |
michael@0 | 230 | do_check_eq(master2.getElementsByAttribute("foo:foo", "bar").length, |
michael@0 | 231 | 3); |
michael@0 | 232 | do_check_eq(master3.getElementsByAttribute("foo:foo", "bar").length, |
michael@0 | 233 | 2); |
michael@0 | 234 | do_check_eq(external.getElementsByAttribute("foo:foo", "bar").length, |
michael@0 | 235 | 1); |
michael@0 | 236 | |
michael@0 | 237 | do_check_eq(root.getElementsByAttribute("foo:bar", "foo").length, |
michael@0 | 238 | 7); |
michael@0 | 239 | do_check_eq(master1.getElementsByAttribute("foo:bar", "foo").length, |
michael@0 | 240 | 2); |
michael@0 | 241 | do_check_eq(master2.getElementsByAttribute("foo:bar", "foo").length, |
michael@0 | 242 | 2); |
michael@0 | 243 | do_check_eq(master3.getElementsByAttribute("foo:bar", "foo").length, |
michael@0 | 244 | 2); |
michael@0 | 245 | do_check_eq(external.getElementsByAttribute("foo:bar", "foo").length, |
michael@0 | 246 | 1); |
michael@0 | 247 | |
michael@0 | 248 | do_check_eq(root.getElementsByAttribute("foo:bar", "bar").length, |
michael@0 | 249 | 14); |
michael@0 | 250 | do_check_eq(master1.getElementsByAttribute("foo:bar", "bar").length, |
michael@0 | 251 | 4); |
michael@0 | 252 | do_check_eq(master2.getElementsByAttribute("foo:bar", "bar").length, |
michael@0 | 253 | 4); |
michael@0 | 254 | do_check_eq(master3.getElementsByAttribute("foo:bar", "bar").length, |
michael@0 | 255 | 4); |
michael@0 | 256 | do_check_eq(external.getElementsByAttribute("foo:bar", "bar").length, |
michael@0 | 257 | 2); |
michael@0 | 258 | |
michael@0 | 259 | do_check_eq(root.getElementsByAttribute("foo2:foo", "foo").length, |
michael@0 | 260 | 8); |
michael@0 | 261 | do_check_eq(master1.getElementsByAttribute("foo2:foo", "foo").length, |
michael@0 | 262 | 2); |
michael@0 | 263 | do_check_eq(master2.getElementsByAttribute("foo2:foo", "foo").length, |
michael@0 | 264 | 2); |
michael@0 | 265 | do_check_eq(master3.getElementsByAttribute("foo2:foo", "foo").length, |
michael@0 | 266 | 3); |
michael@0 | 267 | do_check_eq(external.getElementsByAttribute("foo2:foo", "foo").length, |
michael@0 | 268 | 1); |
michael@0 | 269 | |
michael@0 | 270 | do_check_eq(root.getElementsByAttribute("foo:foo", "*").length, |
michael@0 | 271 | 25); |
michael@0 | 272 | do_check_eq(master1.getElementsByAttribute("foo:foo", "*").length, |
michael@0 | 273 | 7); |
michael@0 | 274 | do_check_eq(master2.getElementsByAttribute("foo:foo", "*").length, |
michael@0 | 275 | 7); |
michael@0 | 276 | do_check_eq(master3.getElementsByAttribute("foo:foo", "*").length, |
michael@0 | 277 | 6); |
michael@0 | 278 | do_check_eq(external.getElementsByAttribute("foo:foo", "*").length, |
michael@0 | 279 | 3); |
michael@0 | 280 | |
michael@0 | 281 | do_check_eq(root.getElementsByAttribute("foo2:foo", "bar").length, |
michael@0 | 282 | 0); |
michael@0 | 283 | do_check_eq(root.getElementsByAttribute("foo:foo", "baz").length, |
michael@0 | 284 | 0); |
michael@0 | 285 | } |
michael@0 | 286 | |
michael@0 | 287 | function test_getElementsByAttributeNS() |
michael@0 | 288 | { |
michael@0 | 289 | var doc = ParseFile("nodelist_data_2.xul"); |
michael@0 | 290 | var root = doc.documentElement; |
michael@0 | 291 | |
michael@0 | 292 | // Sadly, DOMParser can't create XULDocument objects. But at least we have a |
michael@0 | 293 | // XULElement! |
michael@0 | 294 | |
michael@0 | 295 | do_check_true(root instanceof nsIDOMXULElement); |
michael@0 | 296 | |
michael@0 | 297 | // Check that getElementsByAttributeNS returns a nodelist. |
michael@0 | 298 | do_check_true(root.getElementsByAttributeNS("*", "*", "*") instanceof |
michael@0 | 299 | nsIDOMNodeList); |
michael@0 | 300 | |
michael@0 | 301 | var master1 = doc.getElementById("master1"); |
michael@0 | 302 | var master2 = doc.getElementById("master2"); |
michael@0 | 303 | var master3 = doc.getElementById("master3"); |
michael@0 | 304 | var external = doc.getElementById("external"); |
michael@0 | 305 | |
michael@0 | 306 | do_check_true(master1 instanceof nsIDOMXULElement); |
michael@0 | 307 | do_check_true(master2 instanceof nsIDOMXULElement); |
michael@0 | 308 | do_check_true(master3 instanceof nsIDOMXULElement); |
michael@0 | 309 | do_check_true(external instanceof nsIDOMXULElement); |
michael@0 | 310 | |
michael@0 | 311 | // Test wildcard namespace |
michael@0 | 312 | do_check_eq(root.getElementsByAttributeNS("*", "foo", "foo").length, |
michael@0 | 313 | 38); |
michael@0 | 314 | do_check_eq(master1.getElementsByAttributeNS("*", "foo", "foo").length, |
michael@0 | 315 | 11); |
michael@0 | 316 | do_check_eq(master2.getElementsByAttributeNS("*", "foo", "foo").length, |
michael@0 | 317 | 10); |
michael@0 | 318 | do_check_eq(master3.getElementsByAttributeNS("*", "foo", "foo").length, |
michael@0 | 319 | 11); |
michael@0 | 320 | |
michael@0 | 321 | do_check_eq(root.getElementsByAttributeNS("*", "foo", "bar").length, |
michael@0 | 322 | 16); |
michael@0 | 323 | do_check_eq(master1.getElementsByAttributeNS("*", "foo", "bar").length, |
michael@0 | 324 | 4); |
michael@0 | 325 | do_check_eq(master2.getElementsByAttributeNS("*", "foo", "bar").length, |
michael@0 | 326 | 5); |
michael@0 | 327 | do_check_eq(master3.getElementsByAttributeNS("*", "foo", "bar").length, |
michael@0 | 328 | 4); |
michael@0 | 329 | |
michael@0 | 330 | do_check_eq(root.getElementsByAttributeNS("*", "bar", "bar").length, |
michael@0 | 331 | 21); |
michael@0 | 332 | do_check_eq(master1.getElementsByAttributeNS("*", "bar", "bar").length, |
michael@0 | 333 | 6); |
michael@0 | 334 | do_check_eq(master2.getElementsByAttributeNS("*", "bar", "bar").length, |
michael@0 | 335 | 6); |
michael@0 | 336 | do_check_eq(master3.getElementsByAttributeNS("*", "bar", "bar").length, |
michael@0 | 337 | 6); |
michael@0 | 338 | |
michael@0 | 339 | do_check_eq(root.getElementsByAttributeNS("*", "foo", "*").length, |
michael@0 | 340 | 54); |
michael@0 | 341 | do_check_eq(master1.getElementsByAttributeNS("*", "foo", "*").length, |
michael@0 | 342 | 15); |
michael@0 | 343 | do_check_eq(master2.getElementsByAttributeNS("*", "foo", "*").length, |
michael@0 | 344 | 15); |
michael@0 | 345 | do_check_eq(master3.getElementsByAttributeNS("*", "foo", "*").length, |
michael@0 | 346 | 15); |
michael@0 | 347 | |
michael@0 | 348 | // Test null namespace. This should be the same as getElementsByAttribute. |
michael@0 | 349 | do_check_eq(root.getElementsByAttributeNS("", "foo", "foo").length, |
michael@0 | 350 | root.getElementsByAttribute("foo", "foo").length); |
michael@0 | 351 | do_check_eq(master1.getElementsByAttributeNS("", "foo", "foo").length, |
michael@0 | 352 | master1.getElementsByAttribute("foo", "foo").length); |
michael@0 | 353 | do_check_eq(master2.getElementsByAttributeNS("", "foo", "foo").length, |
michael@0 | 354 | master2.getElementsByAttribute("foo", "foo").length); |
michael@0 | 355 | do_check_eq(master3.getElementsByAttributeNS("", "foo", "foo").length, |
michael@0 | 356 | master3.getElementsByAttribute("foo", "foo").length); |
michael@0 | 357 | |
michael@0 | 358 | // Test namespace "foo" |
michael@0 | 359 | do_check_eq(root.getElementsByAttributeNS("foo", "foo", "foo").length, |
michael@0 | 360 | 24); |
michael@0 | 361 | do_check_eq(master1.getElementsByAttributeNS("foo", "foo", "foo").length, |
michael@0 | 362 | 7); |
michael@0 | 363 | do_check_eq(master2.getElementsByAttributeNS("foo", "foo", "foo").length, |
michael@0 | 364 | 6); |
michael@0 | 365 | do_check_eq(master3.getElementsByAttributeNS("foo", "foo", "foo").length, |
michael@0 | 366 | 7); |
michael@0 | 367 | |
michael@0 | 368 | do_check_eq(root.getElementsByAttributeNS("foo", "foo", "bar").length, |
michael@0 | 369 | 9); |
michael@0 | 370 | do_check_eq(master1.getElementsByAttributeNS("foo", "foo", "bar").length, |
michael@0 | 371 | 2); |
michael@0 | 372 | do_check_eq(master2.getElementsByAttributeNS("foo", "foo", "bar").length, |
michael@0 | 373 | 3); |
michael@0 | 374 | do_check_eq(master3.getElementsByAttributeNS("foo", "foo", "bar").length, |
michael@0 | 375 | 2); |
michael@0 | 376 | |
michael@0 | 377 | do_check_eq(root.getElementsByAttributeNS("foo", "bar", "foo").length, |
michael@0 | 378 | 7); |
michael@0 | 379 | do_check_eq(master1.getElementsByAttributeNS("foo", "bar", "foo").length, |
michael@0 | 380 | 2); |
michael@0 | 381 | do_check_eq(master2.getElementsByAttributeNS("foo", "bar", "foo").length, |
michael@0 | 382 | 2); |
michael@0 | 383 | do_check_eq(master3.getElementsByAttributeNS("foo", "bar", "foo").length, |
michael@0 | 384 | 2); |
michael@0 | 385 | |
michael@0 | 386 | do_check_eq(root.getElementsByAttributeNS("foo", "bar", "bar").length, |
michael@0 | 387 | 14); |
michael@0 | 388 | do_check_eq(master1.getElementsByAttributeNS("foo", "bar", "bar").length, |
michael@0 | 389 | 4); |
michael@0 | 390 | do_check_eq(master2.getElementsByAttributeNS("foo", "bar", "bar").length, |
michael@0 | 391 | 4); |
michael@0 | 392 | do_check_eq(master3.getElementsByAttributeNS("foo", "bar", "bar").length, |
michael@0 | 393 | 4); |
michael@0 | 394 | } |