| Summary: | The :checked pseudoselector for slotted content fails to repaint | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Istvan Tutto <istvantutto> | ||||
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | akeerthi, koivisto, rniwa, robin, simon.fraser, webkit-bug-importer, wenson_hsieh, zalan | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 15 | ||||||
| Hardware: | Mac (Intel) | ||||||
| OS: | macOS 11 | ||||||
| URL: | https://codepen.io/istutto/pen/eYjmywN | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 148695 | ||||||
| Attachments: |
|
||||||
|
Description
Istvan Tutto
2022-12-21 03:45:07 PST
Created attachment 464251 [details]
Reduction
This seems to be a repaint bug. The attached test case uses Element::click() to mark the checkbox (instead of requiring keyboard input from user). The checkbox turns blue as expected once you hover over the associated label, deactivate the window, etc... interestingly it works fine when no customElements are involved.
<style>
input[type=checkbox] {
appearance: none;
width: 50px;
height: 50px;
}
input[type=checkbox]:checked {
background-color: green;
}
</style>
<script>
onload = () => {
checkbox.focus();
setTimeout(() => checkbox.click(), 0);
}
</script>
<input type=checkbox id=checkbox>
I think something in the paint invalidation logic is failing to take slotted content into account. The render tree does not seem to get notified about the style change :| Hello, A kindly reminder that this bug has been reported around 18 months ago and the bug still exists in the latest versions as well. |