Skip to content

Commit a7bd9cc

Browse files
josepharharmoz-wptsync-bot
authored andcommitted
Bug 1941899 [wpt PR 50108] - Make ElementInnerTextCollector use new <select> content model, a=testonly
Automatic update from web-platform-tests Make ElementInnerTextCollector use new <select> content model Fixed: 387440276 Change-Id: If074f5c820fe1f7645d73e11423976ac8490bf64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6173103 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1408182} -- wpt-commits: 97afb9f0547d6d56d7c2f23efaaed8f47dc4401e wpt-pr: 50108
1 parent b567bac commit a7bd9cc

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)