Skip to content

Commit

Permalink
Fix invalidation for base-select select:open
Browse files Browse the repository at this point in the history
This patch moves the invalidation for :open on select elements to the
same place as :popover-open in order to prevent a crash. This is more
correct because the selector checker for select:open looks at
:popover-open when in base appearance mode.

This patch also uncovers a new way to hit the CHECK in
ManuallyAssignSlots which I was already planning on removing in
http://crrev.com/c/5953628 so I am removing it in this patch instead.

Fixed: 375004874, 364924715
Change-Id: I36b8c1e9d467c8d40623eb83bc3a8d5154fc9218
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5979628
Reviewed-by: Rune Lillesveen <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1379073}
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Nov 6, 2024
1 parent ff335ed commit 67feadb
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<link rel=author href="mailto:[email protected]">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://issues.chromium.org/issues/375004874">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<style>
select,
::picker(select) {
appearance: base-select;
}

.amount {
position: absolute;
position-anchor: --my-select;
}

select:open selectedoption {
.amount {
display: none;
}
}
</style>

<select>
<button>
<selectedoption></selectedoption>
</button>
<div>
<option>
<div class="title">Potion</div>
<div class="amount">10</div>
</option>
</div>
</select>

<script>
promise_test(async () => {
await test_driver.click(document.querySelector('button'));
await new Promise(requestAnimationFrame);
}, 'This test passes if it does not crash.');
</script>

0 comments on commit 67feadb

Please sign in to comment.