Open Bug 1810708 Opened 3 years ago Updated 3 years ago

checkbox input box-shadow size is wrongly limited

Categories

(Core :: Web Painting, defect, P3)

Firefox 109
defect

Tracking

()

UNCONFIRMED

People

(Reporter: vsync.design, Unassigned)

References

Details

Attachments

(2 files)

Attached image firefox-bug.png —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Steps to reproduce:

Go here:

https://jsbin.com/wihumem/edit?html,css,output

O use this CSS:

body {
height: 100vh;
}

input {
/* does not work as expected: */
box-shadow: 0 0 0 9999px yellow;

/* works as expected: /
/
outline: 9999px solid yellow; */
}

With this HTML:

<body>
<input type='checkbox'/>
</body>

Actual results:

Box-shadow extends barely 3 times the size of the (tiny) checkbox input

Expected results:

Checkbox input should have box-yellow shadow that extends outwards by 9999px pixels

Works as expected in Chrome (tested on v109.0.5414.74)

Component: Untriaged → Layout
Product: Firefox → Core
See Also: → 1760298

This is hitting the box-shadow fallback here because it's a native checkbox. As per that comment, we could do better and just provide the right rect to WebRender, but it's tricky to make sure stuff doesn't get out of sync. outline works, but doesn't account for the checkbox radii.

Apparently in Chromium:

  • Checkbox radii is not accounted for (just like in our case for outline).
  • For textboxes, box-shadow disables the native appearance (seems wrong / unfortunate).

We could implement that but it's unclear if the trade-offs are better. I guess we could disable the fallback path which might be nice but...

Severity: -- → S3
Component: Layout → Web Painting
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: