Closed Bug 1622893 Opened 4 years ago Closed 4 years ago

Input elements blend into background when using HCM on GTK

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: morgan, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached image gtk_hcm.png

STR:

  1. Enable high contrast mode in firefox on GTK
  2. Navigate to http://rarbg.to/torrents.php?category=2;18;41;49

Expected:
Search bar remains visible with a border separating it from the white background

Actual:
Search bar has no border when HCM is enabled and blends into the page

See attached screenshots. My guess is this is an issue with how we style GTK native elements, since I can't reproduce on Mac.

Thanks to :bdekoz for reporting :)

Attached image gtk_non_hcm.png
Attached image mac_HCM.png

So a reduced test-case would be: data:text/html,<input type=text style="border: 1px solid black" placeholder="check me out">.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

So the issue is here, sorta.

We keep this border-color, but allow the author to override the border style to solid, so we paint a border which is effectively the background color... Which is obviously not great.

Flags: needinfo?(emilio)

On high contrast themes, we avoid using the colors from the author to ensure
contrast.

We allow the border-style though, and that unfortunately means that:

<input type=text style="border: 1px solid black">

Ends up rendering like:

<input type=text style="border-style: solid; border-width: 1px">

Which for a theme with a white background means that we'll render a white
border which users can't see, and is unfortunate.

Hard-code these colors, as using the background color for the light variant
doesn't seem right anyway, and the dark variant was hard-coded already.

These colors are taken from the cocoa widget. You can see the change in colors
with something like:

<input type=text style="border-width: 2px">

For default themes it makes the colors a bit less subtle. But I don't think it
matters all that much in practice since the fallback unthemed border is very
rare on the web these days.

The rendering here is still not great, to be clear (we may want to tweak the
high-contrast heuristics here), but it's way better than invisible borders.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ffafdc7c9f84
Don't use background color for 3d colors on GTK. r=stransky
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5497bb642dfd
Don't use background color for 3d colors on GTK. r=stransky
Attachment #9133830 - Attachment description: Bug 1622893 - Don't use background color for 3d colors on GTK. r=stransky,karlt → Bug 1622893 - Don't use background color for 3d colors on GTK. r=stransky
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0657a96ccdc6
Don't use background color for 3d colors on GTK. r=stransky
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: