Closed Bug 1702940 Opened 3 years ago Closed 3 years ago

background-color not set correctly in sidebar <select> and <option> elements

Categories

(Firefox :: Theme, defect)

Firefox 87
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: trittson, Assigned: emilio)

Details

Attachments

(3 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

  1. Create an add-on with a sidebar (you can use the annotate-page example to get set up quickly: https://github.com/mdn/webextensions-examples/tree/master/annotate-page)
  2. On the sidebar page, add a <select> item with a few <option> elements inside. Set background-color of <select> and <option> elements to an arbitrary color (e.g. black). Example codepen: https://codepen.io/eliykat/pen/bGgRgvm (note this codepen exhibits the expected behaviour because it is not in a sidebar)
  3. Click the <select> item to open the dropdown list

Actual results:

background-color is not set on the <option> elements and therefore defaults to white.
This occurs any time the <option> background-color is the same as the <select> background-color. Changing the <option> background-color even by 1 unit will exhibit the expected behaviour.

Expected results:

background-color on <option> elements should be set per the CSS styling, irrespective of the background-color on the parent <select> element. Codepen example shows the expected behaviour.

Expected behaviour also occurs in the add-on popup.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

Can you post an screenshot of what you see? I see a working <select> here (on Linux though).

Flags: needinfo?(trittson)
Flags: needinfo?(trittson)

Could you also attach your example add-on showing the problem, so we can be sure we're looking at the same thing? Thanks.

Flags: needinfo?(trittson)
Flags: needinfo?(trittson)
Attachment #9213649 - Attachment is obsolete: true
Attachment #9213650 - Attachment is obsolete: true

I've attached a minimal add-on which shows the bug, plus a short recording to show you exactly what I'm seeing.

The add-on will open in the sidebar (exhibiting the bug) and in the browser-action popup window (exhibiting the expected behaviour). Per the CSS of the extension, the dropdown items should have white text on a black background. However, when we open the dropdown in the sidebar, the background defaults to white, making the text unreadable.

Thanks, yeah, that looks pretty bad, I'll try to take a look. I think this might be fixed on Nightly via some related fixes I made, if this is using the general select popup code.

Severity: -- → S2
Flags: needinfo?(emilio)

So that the rules apply to the popup in
browser/base/content/webext-panels.xhtml and about:addons as well.

Assignee: nobody → emilio

So I took a look (sorry for the lag, this doesn't repro on Linux so it took a bit more time) and this is a front-end issue. Will fix anyways.

Assignee: emilio → nobody
Status: UNCONFIRMED → NEW
Component: Layout: Form Controls → Theme
Ever confirmed: true
Flags: needinfo?(emilio)
Product: Core → Firefox
Assignee: nobody → emilio
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1a9cd609d14d
Move content select dropdown rules from browser.css to global.css. r=Gijs
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Hey Emilio, thanks for sorting this one out! That was a really quick turnaround for a pretty minor bug. Much appreciated.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: