Skip to content

Commit

Permalink
Revert "Handle appearance value changes during <select> showPicker."
Browse files Browse the repository at this point in the history
This reverts commit b0d64404c5c3c10ac474752095c0ecea7501574a.

Reason for revert: Failing consistently on a number of builders, e.g. https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/50289/overview.

Original change's description:
> Handle appearance value changes during <select> showPicker.
>
> When the appearance value changes as the result of the picker
> opening (e.g. via `::picker(select):open {appearance:auto}` or
> similar), we close the picker to avoid any oscillation or
> nonsensical behavior. This CL implements this change.
>
> Fixed: 376097114,370536090,367426156
> Bug: 384394713
> Change-Id: Ic94b1c860782eba594e18fb4469e6826ae6c2d03
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6094831
> Auto-Submit: Mason Freed <masonf@chromium.org>
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Commit-Queue: Mason Freed <masonf@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1397591}

Bug: 384394713
Change-Id: I99a287e125cdf88f6933111181e1a2bdcaf7576d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6103306
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Owners-Override: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397653}
  • Loading branch information
reillyeon authored and chromium-wpt-export-bot committed Dec 18, 2024
1 parent 146b1a5 commit 72af8ee
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</select>

<style>
#test1::picker(select) {
select#test1::picker(select) {
background-color: red;
}
#test1::picker(select):popover-open {
select#test1::picker(select):popover-open {
background-color: green;
}
</style>
Expand All @@ -33,7 +33,7 @@
t.add_cleanup(() => style.remove());
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
assert_equals(getComputedStyle(select1,'::picker(select)').backgroundColor,red);
style.innerHTML = '#test1::picker(select) {appearance: base-select}';
style.innerHTML = '::picker(select) {appearance: base-select}';
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'base-select');
assert_equals(getComputedStyle(select1,'::picker(select)').backgroundColor,red,'still closed, so popover-open doesn\'t match');

Expand All @@ -57,7 +57,7 @@
document.head.append(style);
t.add_cleanup(() => style.remove());
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
style.innerHTML = '#test1::picker(select) {appearance: auto}';
style.innerHTML = '::picker(select) {appearance: auto}';
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'auto');
await test_driver.bless('showPicker');
select1.showPicker();
Expand All @@ -72,7 +72,7 @@
document.head.append(style);
t.add_cleanup(() => style.remove());
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
style.innerHTML = '#test1::picker(select) {appearance: none}';
style.innerHTML = '::picker(select) {appearance: none}';
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
await test_driver.bless('showPicker');
select1.showPicker();
Expand All @@ -88,8 +88,8 @@
t.add_cleanup(() => style.remove());
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
style.innerHTML = `
#test1::picker(select) {appearance: base-select}
#test1::picker(select):popover-open {appearance: auto}
::picker(select) {appearance: base-select}
::picker(select):popover-open {appearance: auto}
`;
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'base-select');
await test_driver.bless('showPicker');
Expand All @@ -109,17 +109,18 @@
document.head.append(style);
t.add_cleanup(() => style.remove());
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
style.innerHTML = '#test1::picker(select) {appearance: base-select}';
style.innerHTML = '::picker(select) {appearance: none}';
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'base-select');
await test_driver.bless('showPicker');
select1.showPicker();
assert_true(select1.matches(':open'));
style.remove();
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
assert_false(select1.matches(':open'),'changing appearance while the picker is open should close it');
assert_equals(getComputedStyle(select1,'::picker(select)').appearance,'none');
}, 'Switching appearance in JS after picker is open should close the picker');
</script>


<button id=reset>Reset</button>
<select id=test2>
<button><selectedcontent></selectedcontent></button>
Expand All @@ -129,13 +130,13 @@
</select>

<style>
#test2, #test2::picker(select) {
select#test2, ::picker(select) {
appearance: base-select;
}
#test2.controlswitch:open {
select#test2.controlswitch:open {
appearance: auto;
}
#test2.pickerswitch:open::picker(select) {
select#test2.pickerswitch:open::picker(select) {
appearance: auto;
}
</style>
Expand Down Expand Up @@ -199,7 +200,7 @@
assert_equals(getComputedStyle(select2).appearance,'base-select');
t.add_cleanup(() => select2.removeAttribute('style'));
select2.setAttribute('style','appearance:auto');
assert_equals(getComputedStyle(select2).appearance,'auto','appearance should still be auto from inline style');
assert_false(select2.matches(':open'),'Adding inline style should close the picker');
assert_equals(getComputedStyle(select2).appearance,'auto','appearance should still be auto from inline style');
},'The select picker is closed if the <select> inline appearance value is changed while the picker is open');
</script>

0 comments on commit 72af8ee

Please sign in to comment.