|
| 1 | +<!DOCTYPE html> |
| 2 | +<link rel= author href=" mailto:[email protected]" > |
| 3 | +<link rel=help href="https://issues.chromium.org/issues/387440276"> |
| 4 | +<script src="/resources/testharness.js"></script> |
| 5 | +<script src="/resources/testharnessreport.js"></script> |
| 6 | +<script src="/resources/testdriver.js"></script> |
| 7 | +<script src="/resources/testdriver-vendor.js"></script> |
| 8 | + |
| 9 | +<select id=oldcontentmodel> |
| 10 | + <option>one</option> |
| 11 | + <optgroup label=emptygroup></optgroup> |
| 12 | + <optgroup label=optgroup> |
| 13 | + <option>two</option> |
| 14 | + </optgroup> |
| 15 | +</select> |
| 16 | + |
| 17 | +<select id=newcontentmodel> |
| 18 | + <option>one</option> |
| 19 | + <optgroup label=emptygroup></optgroup> |
| 20 | + <div> |
| 21 | + <optgroup label=optgroup> |
| 22 | + <div> |
| 23 | + <option> |
| 24 | + <span>two</span> |
| 25 | + </option> |
| 26 | + </div> |
| 27 | + </optgroup> |
| 28 | + </div> |
| 29 | +</select> |
| 30 | + |
| 31 | +<style> |
| 32 | +.base, .base::picker(select) { |
| 33 | + appearance: base-select; |
| 34 | +} |
| 35 | +</style> |
| 36 | + |
| 37 | +<script> |
| 38 | +const expectedText = 'one\ntwo'; |
| 39 | +const oldSelect = document.getElementById('oldcontentmodel'); |
| 40 | +const newSelect = document.getElementById('newcontentmodel'); |
| 41 | + |
| 42 | +test(() => { |
| 43 | + assert_equals(oldSelect.innerText, expectedText); |
| 44 | +}, '<select> innerText with old content model and appearance:auto.'); |
| 45 | + |
| 46 | +test(() => { |
| 47 | + assert_equals(newSelect.innerText, expectedText); |
| 48 | +}, '<select> innerText with new content model and appearance:auto.'); |
| 49 | + |
| 50 | +promise_test(async () => { |
| 51 | + newSelect.classList.add('base'); |
| 52 | + await new Promise(requestAnimationFrame); |
| 53 | + assert_equals(newSelect.innerText, expectedText); |
| 54 | +}, '<select> innerText with new content model and appearance:base-select.'); |
| 55 | + |
| 56 | +promise_test(async () => { |
| 57 | + await test_driver.bless(); |
| 58 | + newSelect.showPicker(); |
| 59 | + assert_equals(newSelect.innerText, expectedText); |
| 60 | +}, '<select> innerText with new content model and appearance:base-select with picker open.'); |
| 61 | +</script> |
0 commit comments