Skip to content

Commit b3881e4

Browse files
committed
Bug 1937928 [wpt PR 49746] - Update customizable select styles, a=testonly
Automatic update from web-platform-tests Update customizable select styles This patch updates background-color and border-radius to the latest proposal here: w3c/csswg-drafts#10857 Change-Id: Icc6ec70d27cc9f1131f5e164b1db66e63e8847fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072270 Commit-Queue: Joey Arhar <jarharchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Auto-Submit: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1397608} -- wpt-commits: 441d9bfafda626484b081e3cd4964489e9608ca2 wpt-pr: 49746 UltraBlame original commit: f51dac500539a26c8cd42d09fa5bbc5ca877cfe4
1 parent 611fd63 commit b3881e4

14 files changed

+54
-26
lines changed

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/resources/customizable-select-styles.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151

5252
.customizable-select-button {
5353
color: inherit;
54-
background-color: color-mix(in lab, currentColor 10%, transparent);
54+
background-color: transparent;
5555
appearance: none;
5656
padding-block: 0.25em;
5757
padding-inline: 0.5em;
5858
border: 1px solid currentColor;
59-
border-radius: 0.25em;
59+
border-radius: 0.5em;
6060
cursor: default;
6161
text-align: inherit;
6262
/* TODO(crbug.com/41483940): Make display match the UA stylesheet. */
@@ -71,6 +71,14 @@
7171
min-block-size: max(24px, 1lh);
7272
}
7373

74+
.customizable-select-button.hover {
75+
background-color: color-mix(in lab, currentColor 10%, transparent);
76+
}
77+
78+
.customizable-select-button.active {
79+
background-color: color-mix(in lab, currentColor 20%, transparent);
80+
}
81+
7482
.customizable-select-button::after {
7583
content: counter(fake-counter-name, disclosure-open);
7684
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<!DOCTYPE html>
22
<link rel=stylesheet href="resources/customizable-select-styles.css">
33

4-
<div class=customizable-select-button popovertarget=popover id=button>
4+
<div class="customizable-select-button active" popovertarget=popover id=button>
55
<span class=customizable-select-selectedoption>option</span>
66
</div>
77
<div id=popover popover=auto anchor=button class=customizable-select-popover>
88
<div class="customizable-select-option selected">option</div>
99
</div>
1010

11-
<style>
12-
.customizable-select-button {
13-
background-color: color-mix(in lab, currentColor 30%, transparent);
14-
}
15-
</style>
16-
1711
<script>
1812
document.getElementById('popover').showPopover();
1913
</script>

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-active.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-29;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
66
<link rel=match href="select-appearance-active-ref.html">

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-dark-mode.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-12">
3+
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-15">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-dark-mode-ref.html">

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-disabled-option-ref.html">

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-font-inheriting.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-50;totalPixels=0-8">
3+
<meta name=fuzzy content="maxDifference=0-55;totalPixels=0-8">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-font-inheriting-ref.html">
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<!DOCTYPE html>
22
<link rel=stylesheet href="resources/customizable-select-styles.css">
33

4-
<div class=customizable-select-button popovertarget=popover id=button>
4+
<div class="customizable-select-button hover" popovertarget=popover id=button>
55
<span class=customizable-select-selectedoption>option</span>
66
</div>
7-
8-
<style>
9-
.customizable-select-button {
10-
background-color: color-mix(in lab, currentColor 20%, transparent);
11-
}
12-
</style>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
66
<link rel=match href="select-appearance-hover-ref.html">

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-switching-invalidation.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-switching-invalidation-ref.html">

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-mouse-behavior.tentative.html

+32
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
}
1616
</style>
1717

18+
<div id=lightdismiss>light dismiss</div>
19+
1820
<label for=custombutton>custom button</label>
1921
<select id=custombutton>
2022
<button>button</button>
@@ -29,6 +31,15 @@
2931
</select>
3032

3133
<script>
34+
function touch(element) {
35+
return (new test_driver.Actions()
36+
.addPointer('finger', 'touch')
37+
.pointerMove(1, 1, {origin: element})
38+
.pointerDown()
39+
.pointerUp())
40+
.send();
41+
}
42+
3243
for (const id of ['fallbackbutton', 'custombutton']) {
3344
const select = document.getElementById(id);
3445
const optionOne = select.querySelector('option.one');
@@ -79,5 +90,26 @@
7990
assert_false(select.matches(':open'),
8091
'select picker should be closed after clicking the label.');
8192
}, `${id}: Clicking the label should focus the select button without opening the picker.`);
93+
94+
promise_test(async () => {
95+
select.value = 'one';
96+
await touch(select);
97+
assert_true(select.matches(':open'),
98+
'Select should open after touching button.');
99+
100+
await touch(optionTwo);
101+
assert_equals(select.value, 'two',
102+
'select.value should be updated after touching another option.');
103+
assert_false(select.matches(':open'),
104+
'Picker should close after touching an option.');
105+
106+
await touch(select);
107+
assert_true(select.matches(':open'),
108+
'Select should re-open after touching button.');
109+
110+
await touch(document.getElementById('lightdismiss'));
111+
assert_false(select.matches(':open'),
112+
'Select should close via light dismiss when touching outside the picker.');
113+
}, `${id}: Touch input should work the same as mouse input.`);
82114
}
83115
</script>

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-open-invalidation.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-open-invalidation-ref.html">

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
await new Promise(requestAnimationFrame);
3838
assert_equals(getComputedStyle(optionOne).color, 'rgb(0, 0, 0)',
3939
'Option color while hovering.');
40-
assert_equals(getComputedStyle(optionOne).backgroundColor, 'lab(0 0 0 / 0.2)',
40+
assert_equals(getComputedStyle(optionOne).backgroundColor, 'lab(0 0 0 / 0.1)',
4141
'Option background-color while hovering.');
4242

4343
await (new test_driver.Actions()

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-option-images-ref.html">

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-second-child-button.tentative.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/pull/10629">
66
<link rel=match href="select-second-child-button-ref.html">

0 commit comments

Comments
 (0)