Bug 1861253 - Draw select's menulist arrow in the select's color. r=dholbert

In the regressing bug 1849793 I removed a hunk like this because we
don't use any of the parent state on the parent properly:

```
  if (aAppearance == StyleAppearance::MozMenulistArrowButton) {
    // HTML select and XUL menulist dropdown buttons get state from the
    // parent.
    nsIFrame* parentFrame = aFrame->GetParent();
    aFrame = parentFrame;
    elementState = GetContentState(parentFrame, aAppearance);
  }
```

However that aFrame = parentFrame also changed the frame we read the
color for the fill. This is not an issue for menus because those don't
override the colors, but for the select menulist button we need to
explicitly inherit.

Differential Revision: https://phabricator.services.mozilla.com/D192002
This commit is contained in:
Emilio Cobos Álvarez 2023-10-27 07:34:43 +00:00
parent a441ab3705
commit c91ee34d5b
4 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<!doctype html>
<select style="color: black">
<option>&nbsp;</option>
</select>

View File

@ -0,0 +1,4 @@
<!doctype html>
<select style="color: white">
<option>&nbsp;</option>
</select>

View File

@ -28,3 +28,4 @@ needs-focus != listbox-focus.html listbox-focus-notref.html
== 1769580.html 1769580-ref.html
== no-padding.html no-padding-ref.html
!= arrow-color.html arrow-color-notref.html

View File

@ -274,6 +274,9 @@ select > button {
block-size: 100%;
box-sizing: border-box;
/* Draw the arrow in the select's color */
color: inherit;
/*
Make sure to align properly with the display frame. Note that we
want the baseline of the combobox to match the baseline of the