Bug 267679
| Summary: | <input type=checkbox switch> paints outside its box and the thumb is slightly misaligned on macOS | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Anne van Kesteren <annevk> |
| Component: | Forms | Assignee: | Anne van Kesteren <annevk> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | akeerthi, cdumez, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Anne van Kesteren
As discovered in https://github.com/WebKit/WebKit/pull/22703#issuecomment-1890437523 <input type=checkbox> (and <input type=checkbox switch>) paint outside their box. Given it's only a couple points per pixel it's presumably shadows.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Aditya Keerthi
If it's the shadows this is not a bug.
If it's the control, then the implication is that these values are wrong:
```
static const int* checkboxMargins(NSControlSize controlSize)
{
static const int margins[4][4] =
{
// top right bottom left
{ 2, 2, 2, 2 },
{ 2, 1, 2, 1 },
{ 0, 0, 1, 0 },
{ 2, 2, 2, 2 },
};
return margins[controlSize];
}
```
Anne van Kesteren
It's only the shadows.
Is there a better way to test that? I guess we should rename the test at least to clarify shadows can leak here.
Radar WebKit Bug Importer
<rdar://problem/121579531>
Anne van Kesteren
When I add masking for the thumb this goes away, so I suspect this was a real bug after all.
Anne van Kesteren
Pull request: https://github.com/WebKit/WebKit/pull/25582
Anne van Kesteren
Hmm, there's still some bleeding on the bots, but noticeably less with that patch.
EWS
Committed 275808@main (5381f48e7a04): <https://commits.webkit.org/275808@main>
Reviewed commits have been landed. Closing PR #25582 and removing active labels.