Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 4 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/the-select-element/customizable-select/select-innertext.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<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 id=oldcontentmodel>
<option>one</option>
<optgroup label=emptygroup></optgroup>
<optgroup label=optgroup>
<option>two</option>
</optgroup>
</select>
<select id=newcontentmodel>
<option>one</option>
<optgroup label=emptygroup></optgroup>
<div>
<optgroup label=optgroup>
<div>
<option>
<span>two</span>
</option>
</div>
</optgroup>
</div>
</select>
<style>
.base, .base::picker(select) {
appearance: base-select;
}
</style>
<script>
const expectedText = 'one\ntwo';
const oldSelect = document.getElementById('oldcontentmodel');
const newSelect = document.getElementById('newcontentmodel');
test(() => {
assert_equals(oldSelect.innerText, expectedText);
}, '<select> innerText with old content model and appearance:auto.');
test(() => {
assert_equals(newSelect.innerText, expectedText);
}, '<select> innerText with new content model and appearance:auto.');
promise_test(async () => {
newSelect.classList.add('base');
await new Promise(requestAnimationFrame);
assert_equals(newSelect.innerText, expectedText);
}, '<select> innerText with new content model and appearance:base-select.');
promise_test(async () => {
await test_driver.bless();
newSelect.showPicker();
assert_equals(newSelect.innerText, expectedText);
}, '<select> innerText with new content model and appearance:base-select with picker open.');
</script>