Closed Bug 1702847 Opened 3 years ago Closed 3 years ago

Poor contrast on some select menus with macos system appearance

Categories

(Core :: Widget, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox87 --- unaffected
firefox88 --- unaffected
firefox89 + fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

data:text/html,<select style="color: rgb(10,10,10)"><option>abc</option><option>def</option>.

I found this on the duo website (the auth select popup). I'm still not sure if this is also an issue on windows.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

This is also an issue with proton in dark mode, and I think that this solution
is sensible.

Does this patch bring Firefox closer to fixing the following issue with <select> dropdowns on macOS?

On macOS Big Sur, comparing Firefox Nightly 2021-04-02 with widget.macos.respect-system-appearance=true to Chrome and Safari (stable).

The test case is from an internal design system I’m working on. Roughly the styles are set on the <select> element, and <option> elements are not styled at all (the Inspector only shows inherited styles for <option> elements). Styles on the <select> include:

  • appearance: none
  • custom color and background-color
  • custom border and border-radius
  • custom padding

In Safari and Chrome, the select dropdown uses the Big Sur native style and is unaffected by author styles. In Firefox, it uses a non-standard style and seems to use the color and background-color from the select element (especially obvious with peculiar colors, see third column in screenshot).

Ideally any change would get Firefox closer to Safari and Chrome here.
But if that’s not possible, is it possible to restrict which styles get inherited and applied to option elements, and maybe only apply custom color and background-color to option elements when they are targeted directly?

/* only applies to the select button, not to the dropdown or options */
select {
  color: blue;
  background: lime;
}

/* may apply to the select options */
option {
  color: purple;
  background: pink;
}

I guess styling of select elements is under-specified, which is what https://open-ui.org/components/select tries to move forward?

Flags: needinfo?(emilio)

No, this shouldn't change behavior in your page. What you want is something close to what you get with dom.forms.select.customstyling=false right? (Perhaps respecting font-size)

If so, that's technically easy to achieve, but it's more of a ux / product decision.

Flags: needinfo?(emilio)

Looks like it! Thanks for the info.

Has Regression Range: --- → yes
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4cb2d77f64d3
Ensure we set the select background from content if either background or color is set. r=Gijs
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Regressions: 1703866
See Also: → 1705089
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: