Permalink
Browse files

Merge pull request #26 from w3c/submissions/opera-htmloptionscollection

Move HTMLOptionsCollection tests to the correct place and update them to the spec.
  • Loading branch information...
2 parents 6933738 + d7d86f4 commit 46f5b1bd36696d206191bf3906adfc532d624d9d @Ms2ger Ms2ger committed Feb 21, 2013
@@ -62,7 +62,6 @@
a_opts.length = 5;
assert_equals(a_opts.length, 5);
assert_equals(a_opts.value, "3");
-
}, "Setting length to original value has no effect");
test(function() {
@@ -153,20 +152,20 @@
}, "namedItem doesn't match anything");
test(function() {
- assert_values_equals(b_opts.namedItem("b3"), ["3", "4"]);
-}, "namedItem matches multiple IDs");
+ assert_equals(b_opts.namedItem("b3").value, "3");
+}, "namedItem multiple IDs");
test(function() {
- assert_values_equals(b_opts.namedItem("b4"), ["5", "6"]);
-}, "namedItem matches multiple names");
+ assert_equals(b_opts.namedItem("b4").value, "5");
+}, "namedItem multiple names");
test(function() {
- assert_values_equals(b_opts.namedItem("b5"), ["7", "8"]);
-}, "namedItem matches multiple name and ID");
+ assert_equals(b_opts.namedItem("b5").value, "7");
+}, "namedItem multiple name and ID");
test(function() {
- assert_values_equals(b_opts.namedItem("b6"), ["9", "10"]);
-}, "namedItem matches multiple name and ID with multiple attributes");
+ assert_equals(b_opts.namedItem("b6").value, "9");
+}, "namedItem multiple name and ID with multiple attributes");
test(function() {
assert_equals(b_opts.namedItem("b8").value, "11");
@@ -176,24 +175,9 @@
assert_equals(b_opts.namedItem("b9").value, "11");
}, "namedItem name attribute multiple attributes one element");
-test(function() {
- var node_list = b_opts.namedItem("b3");
- assert_values_equals(node_list, ["3", "4"]);
- var o = document.createElement("option");
- o.id = "b3";
- o.textContent = "12";
- b.insertBefore(o, b.firstChild);
- try {
- assert_values_equals(node_list, ["12", "3", "4"]);
- } finally {
- b.removeChild(o);
- }
-}, "namedItem returns a live node list");
-
test(function() {
var add = document.createElement("p");
- b_opts.add(add);
- assert_equals(add.parentNode, null);
+ assert_throws(new TypeError(), function() {b_opts.add(add);});
}, "Add non-option to collection");
</script>

0 comments on commit 46f5b1b

Please sign in to comment.