Closed Bug 381647 Opened 17 years ago Closed 17 years ago

Aqua menu-style selects supress background, but not foreground

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: stuart.morgan+bugzilla, Assigned: jaas)

References

()

Details

Attachments

(3 files)

The change in bug 381268 made Aqua menu-style selects discard background information, but they don't do anything about foreground, which means that if someone styles a select with a dark background and light text, you end up with light text on an essentially white background, which is really bad.

I don't have time to make a new minimal testcase at the moment, but see the "Select (as an Aqua menulist)" section of https://bugzilla.mozilla.org/attachment.cgi?id=201986 where the select should be light pink on a dark blue background.

Probably this case should fall back to non-themed widgets; alternately, the text color needs to be fixed to system text colors.
Flags: blocking1.9?
philippe somewhere has a screenshot of what WebKit does, which is probably a not-for-1.9 possibility ;)
Attached file minimal test case (deleted) —
select {background:#000; color:#ff7f00;}
Attached image screenshot of test case in WebKit (deleted) —
IE 7 win32 does something similar.
Flags: blocking1.9? → blocking1.9+
We have two options here - when the foreground color changes we can either suppress the change or fall back to gfx widgets.

If we want to suppress the foreground color change, how do we do that?

If we want to go to gfx widgets, I have a patch that does that with one major problem. When the dropdown widget falls back we needs its gfx dropmarker to fall back as well. Otherwise we get a gfx widget with a native dropmarker inside. Perhaps we could get the comboboxcontrolframe to say:

if (this->-moz-appearance == none && !theme->ThemeNeedsComboboxDropmarker())
  this->dropmarker_child->-moz-appearance = none;

Any ideas roc?
I would prefer to back to gfx widgets.

nsComboboxControlFrame needs a method that determines whether the combobox should be themed or not. This should examine all relevant styles on the combobox, and it should be called by both the combobox frame and the dropdown marker frame.
Attached patch fix v1.0 (deleted) — Splinter Review
Attachment #278480 - Flags: review?(cbarrett)
Comment on attachment 278480 [details] [diff] [review]
fix v1.0


>+  // if this is a dropdown button in a combobox the answer is always no
>+  if (aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
>+    nsIFrame* parentFrame = aFrame->GetParent();
>+    if (parentFrame && (parentFrame->GetType() == nsWidgetAtoms::comboboxControlFrame))
>+      return PR_FALSE;
>+  }
> 
>   switch (aWidgetType) {
>+    case NS_THEME_LISTBOX:
>+      return PR_TRUE; // we always want listboxes themed, non-themed ones look wrong
>+      break;
>+

The listbox v. combobox v. dropdown terminology is a bit confusing (I've never understood what the difference is in Gecko terms). I tested the patch and it works.
Attachment #278480 - Flags: review?(cbarrett) → review+
Attachment #278480 - Flags: superreview?(roc)
Attachment #278480 - Flags: superreview?(roc) → superreview+
fixed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: