diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 0304cf7532d..7f95b602122 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -37713,7 +37713,16 @@ "local_changes": { "deleted": [], "deleted_reftests": {}, - "items": {}, + "items": { + "testharness": { + "html/semantics/forms/the-select-element/common-HTMLOptionsCollection-add.html": [ + { + "path": "html/semantics/forms/the-select-element/common-HTMLOptionsCollection-add.html", + "url": "/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-add.html" + } + ] + } + }, "reftest_nodes": {} }, "reftest_nodes": { diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index 85354ada30b..9b6a26bfa3b 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -1083,27 +1083,6 @@ [HTMLCollection interface: calling namedItem(DOMString) on document.createElement("form").elements with too few arguments must throw TypeError] expected: FAIL - [HTMLOptionsCollection interface: existence and properties of interface object] - expected: FAIL - - [HTMLOptionsCollection interface object length] - expected: FAIL - - [HTMLOptionsCollection interface: existence and properties of interface prototype object] - expected: FAIL - - [HTMLOptionsCollection interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [HTMLOptionsCollection interface: attribute length] - expected: FAIL - - [HTMLOptionsCollection interface: operation add([object Object\],[object Object\],[object Object\],[object Object\])] - expected: FAIL - - [HTMLOptionsCollection interface: operation remove(long)] - expected: FAIL - [HTMLOptionsCollection interface: attribute selectedIndex] expected: FAIL @@ -3747,18 +3726,6 @@ [HTMLSelectElement interface: attribute required] expected: FAIL - [HTMLSelectElement interface: attribute options] - expected: FAIL - - [HTMLSelectElement interface: operation namedItem(DOMString)] - expected: FAIL - - [HTMLSelectElement interface: operation remove()] - expected: FAIL - - [HTMLSelectElement interface: operation remove(long)] - expected: FAIL - [HTMLSelectElement interface: attribute selectedOptions] expected: FAIL @@ -3792,15 +3759,6 @@ [HTMLSelectElement interface: document.createElement("select") must inherit property "required" with the proper type (6)] expected: FAIL - [HTMLSelectElement interface: document.createElement("select") must inherit property "options" with the proper type (9)] - expected: FAIL - - [HTMLSelectElement interface: document.createElement("select") must inherit property "namedItem" with the proper type (12)] - expected: FAIL - - [HTMLSelectElement interface: calling namedItem(DOMString) on document.createElement("select") with too few arguments must throw TypeError] - expected: FAIL - [HTMLSelectElement interface: document.createElement("select") must inherit property "selectedOptions" with the proper type (17)] expected: FAIL @@ -6456,9 +6414,6 @@ [HTMLAllCollection interface object name] expected: FAIL - [HTMLOptionsCollection interface object name] - expected: FAIL - [HTMLPropertiesCollection interface object name] expected: FAIL diff --git a/tests/wpt/metadata/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html.ini b/tests/wpt/metadata/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html.ini index a823a4e45d3..eb045799edd 100644 --- a/tests/wpt/metadata/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html.ini +++ b/tests/wpt/metadata/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html.ini @@ -1,14 +1,5 @@ [htmloptionscollection.html] type: testharness - [Original length] - expected: FAIL - - [Setting length to original value has no effect] - expected: FAIL - - [Setting length to shorter value] - expected: FAIL - [Setting length to longer value] expected: FAIL @@ -24,48 +15,5 @@ [Insert into + + + + + + + + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html index 6bae66ccf78..307b73f8722 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html @@ -67,4 +67,33 @@ test(function () { assert_equals(selly.children.length, 4, "Number of children should have changed"); }, "Setting a length lower than the old length trims nodes from the end"); + +test(function () { + var opts = selly.options; + opts[3] = null; + assert_equals(selly[3], undefined, + "previously set node is now undefined"); + assert_equals(selly.length, 3, + "Number of nodes in collection is correctly changed"); + assert_equals(selly.children.length, 3, + "Number of children should have changed"); +}, "Setting element to null by index removed the element"); + +test(function () { + var opts = selly.options; + var new_option = document.createElement("option"); + var replace_option = new_option.cloneNode(true); + new_option.value = "-1"; + replace_option.value = "a"; + opts[5] = new_option; + opts[0] = replace_option; + + var elarray = []; + for (var i = 0; i < selly.length; i++) { + elarray.push(selly[i].value); + } + assert_array_equals(elarray, ["a", "2", "3", "", "", "-1"]); + +}, "Setting element by index should correctly append and replace elements"); +