diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-select-element/stylable-select/nested-options.tenative.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/forms/the-select-element/stylable-select/nested-options.tenative.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/stylable-select/nested-options.tenative.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/stylable-select/nested-options.tenative.html new file mode 100644 index 0000000000..7e89a5ad42 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/stylable-select/nested-options.tenative.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1422275"> +<link rel=help href="https://chromium-review.googlesource.com/c/chromium/src/+/5441435/1#message-cd8841d92a672a0276ab536dfaf3a20e93d5e6e3"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> + +<select> + <datalist> + <option id=o1> + parent + <option id=o2>child</option> +</option> + </datalist> +</select> + +<script> +const select = document.querySelector('select'); + +test(() => { + assert_equals(select.innerHTML, ` + <datalist> + <option id="o1"> + parent + </option><option id="o2">child</option> + + </datalist> +`); +}, 'The HTML parser should disallow nested options in select datalist.'); + +// Manually nest the <options> anyway for the following tests. +o1.appendChild(o2); + +test(() => { + assert_equals(select.options.length, 2, 'select.options.length'); + assert_equals(select.options[0], o1, 'select.options[0]'); + assert_equals(select.options[1], o2, 'select.options[1]'); +}, 'Nested <options> should be listed in <select> IDLs.'); + +promise_test(async () => { + await test_driver.bless(); + select.showPicker(); +}, 'Showing the popup with nested <option>s should not crash.'); +</script> |