Skip to content

Commit ef03c6a

Browse files
josepharharmoz-wptsync-bot
authored andcommitted
Bug 1931109 [wpt PR 49158] - Update option colors for customizable select, a=testonly
Automatic update from web-platform-tests Update option colors for customizable select This patch updates the colors of options to the latest proposal here: w3c/csswg-drafts#10909 Change-Id: I70f219c6211f9541d30db2140c26a8d62c93ee74 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021215 Reviewed-by: Traian Captan <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1383099} -- wpt-commits: 6d039d28ccbef2134d2c35262c5d63cac2072182 wpt-pr: 49158
1 parent e0c8ce9 commit ef03c6a

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-option-hover-styles.tentative.html

+9-28
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@
88
<script src="/resources/testdriver-actions.js"></script>
99

1010
<style>
11-
#selecteditem {
12-
color: SelectedItemText;
13-
background-color: SelectedItem;
14-
}
1511
select, select::picker(select) {
1612
appearance: base-select;
1713
}
1814
</style>
19-
<div id=selecteditem>SelectedItem test colors</div>
2015

2116
<select>
2217
<option class=one>one</option>
@@ -31,11 +26,6 @@
3126
const disabledOption = document.querySelector('.three');
3227

3328
promise_test(async () => {
34-
await new Promise(requestAnimationFrame);
35-
const selectedItemTestElement = document.getElementById('selecteditem');
36-
const selectedItemTextColor = getComputedStyle(selectedItemTestElement).color;
37-
const selectedItemColor = getComputedStyle(selectedItemTestElement).backgroundColor;
38-
3929
await test_driver.bless();
4030
select.showPicker();
4131
assert_true(select.matches(':open'),
@@ -45,27 +35,18 @@
4535
.pointerMove(1, 1, {origin: optionOne}))
4636
.send();
4737
await new Promise(requestAnimationFrame);
48-
49-
assert_equals(getComputedStyle(optionOne).color, selectedItemTextColor,
50-
'The hovered option should have color:SelectedItemText.');
51-
assert_equals(getComputedStyle(optionOne).backgroundColor, selectedItemColor,
52-
'The hovered option should have background-color:SelectedItem.');
53-
// SelectedItemTextColor might be the same as the default text color, so
54-
// don't test that optionTwo's color isn't selectedItemTextColor.
55-
assert_not_equals(getComputedStyle(optionTwo).backgroundColor, selectedItemColor,
56-
'The not hovered option should not have background-color:SelectedItem.');
57-
58-
const disabledColor = getComputedStyle(disabledOption).color;
59-
const disabledBackgroundColor = getComputedStyle(disabledOption).backgroundColor;
38+
assert_equals(getComputedStyle(optionOne).color, 'rgb(0, 0, 0)',
39+
'Option color while hovering.');
40+
assert_equals(getComputedStyle(optionOne).backgroundColor, 'lab(0 0 0 / 0.2)',
41+
'Option background-color while hovering.');
6042

6143
await (new test_driver.Actions()
62-
.pointerMove(1, 1, disabledOption))
44+
.pointerMove(1, 1, {origin: disabledOption}))
6345
.send();
6446
await new Promise(requestAnimationFrame);
65-
66-
assert_equals(getComputedStyle(disabledOption).color, disabledColor,
67-
'Disabled options should not change color when hovered.');
68-
assert_equals(getComputedStyle(disabledOption).backgroundColor, disabledBackgroundColor,
69-
'Disabled options should not change background-color when hovered.');
47+
assert_equals(getComputedStyle(disabledOption).color, 'lab(0 0 0 / 0.5)',
48+
'Disabled option color while hovering.');
49+
assert_equals(getComputedStyle(disabledOption).backgroundColor, 'rgba(0, 0, 0, 0)',
50+
'Disabled option background-color while hovering.');
7051
}, 'Hover styles should be present for appearance:base-select options.');
7152
</script>

0 commit comments

Comments
 (0)