summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js
new file mode 100644
index 0000000000..4e4c2df77e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-removal.window.js
@@ -0,0 +1,7 @@
+test(() => {
+ const select = document.createElement("select");
+ select.innerHTML = "<optgroup><option>1<optgroup><option>2";
+ assert_equals(select.value, "1");
+ select.querySelector("optgroup").remove();
+ assert_equals(select.value, "2");
+}, "<select> needs to be updated when <optgroup> is removed");