GTK <progress> widget is unusable with GTK3 on Ubuntu 15.10 ("thumb" is same color as background), with "Ambiance" & "Radiance" themes

RESOLVED FIXED in Firefox 43, Firefox OS v2.5

Status

()

Core
Widget: Gtk
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: dholbert, Unassigned)

Tracking

Trunk
mozilla45
Points:
---

Firefox Tracking Flags

(firefox43 fixed, firefox44 fixed, firefox45 fixed, b2g-v2.5 fixed)

Details

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

3 years ago
STR:
 1. Load this data URL:
     data:text/html,<progress>

  2. Look at the colors.

ACTUAL RESULTS:
Really hard to distinguish "thumb" from background. Both are light-gray (the same color I think), and they're separated by an extremely thin orange halo.

EXPECTED RESULTS:
Useful colors in <progress> bar.


NOTES:
 - I can reproduce this in Nightly 44, but not in Release (41), so I'm pretty sure this is a regression from the switch to GTK3.
 - I can reproduce this on Ubuntu 15.10, but not on Ubuntu 15.04 (using Nightly in both). So there's some theme dependency here.
(Reporter)

Updated

3 years ago
Summary: GTK <progress> widget "thumb" is same color as background → GTK <progress> widget is unusable with GTK3 on Ubuntu 15.10 ("thumb" is same color as background)
(Reporter)

Comment 1

3 years ago
Created attachment 8678356 [details]
screenshot comparing Nighlty on Ubuntu 15.10 vs 15.04, vs. no-gtk3 (release)
(Reporter)

Comment 2

3 years ago
Data URL used in the screenshot is:
 data:text/html,<progress value="0.8">
but you can see this with any <progress> widget.
(Reporter)

Comment 3

3 years ago
Created attachment 8678358 [details]
screencast of bug, w/ bouncing <progress>

Here's a screencast showing how this looks with the bouncing <progress> animation.
(Reporter)

Comment 4

3 years ago
Results from changing my theme using gnome-tweak-tool:

 THEME       BUG/No bug     NOTES
 =====       ==========     =====
 "Ambiance"   BUG           This is Ubuntu's default theme, IIUC. (It's what was set for me.)

 "Radiance"   BUG           (similar to Ambiance, per bug 1187203.)

 "Adwaita"    No bug        Solid blue thumb on gray background. Great!
                            (This is Gnome's default, I think, though Ubuntu's selection overrides it.)
Summary: GTK <progress> widget is unusable with GTK3 on Ubuntu 15.10 ("thumb" is same color as background) → GTK <progress> widget is unusable with GTK3 on Ubuntu 15.10 ("thumb" is same color as background), with "Ambiance" & "Radiance" themes
(Reporter)

Comment 5

3 years ago
I was wondering if the reason this repro's on Ubuntu 15.10 not Ubuntu 15.04 was due to a difference in the theme CSS. But I don't think that's the case.

I tested that by replacing my Ubuntu 15.10 ambiance GTK3 theme directory (/usr/share/themes/Ambiance/gtk-3.0/) with the same directory taken from an Ubuntu 15.04 machine, and restarting Firefox. That didn't fix this or have any noticeable impact at all.  (And if this were a theme-CSS issue, I'd expect it to have had an impact, based on bug 1187203 comment 15.)

So, this is a bit mysterious.
(Reporter)

Comment 6

3 years ago
One other theory that I considered as an explanation for the 15.04-vs-15.10 difference, but I think I've shot down:

 * We draw progressbar chunks differently based on GTK version:

> 2059     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
> 2060     // gtk_render_activity was used to render progress chunks on GTK versions
> 2061     // before 3.13.7, see bug 1173907.
> 2062     if (gtk_check_version(3, 13, 7))
> 2063       gtk_render_activity(style, cr, rect->x, rect->y, rect->width, rect->height);
http://mxr.mozilla.org/mozilla-central/source/widget/gtk/gtk3drawing.c#2012

If Ubuntu versions took different codepaths there based on GTK version, that would explain this... but alas, both Ubuntu versions have a GTK version that's newer than the one checked there. (libgtk-3-0 package version is 3.14.12 on my Ubuntu 15.04 box, 3.16.7 on my Ubuntu 15.10 box.)

So, I don't know what explains the difference in behavior.
(Reporter)

Comment 7

3 years ago
(IMO we should consider having this bug block the shipping of GTK3, since it makes one of our widgets pretty useless, with default theme settings on the latest version of the most popular (I think?) linux distro. Marking as blocking 'ship-gtk3' for the moment.)
Blocks: 1193807
Comment hidden (obsolete)
(Reporter)

Updated

3 years ago
Attachment #8678380 - Attachment filename: file_1218008.txt → file_1218008.html
Attachment #8678380 - Attachment mime type: text/plain → text/html
(Reporter)

Updated

3 years ago
Attachment #8678380 - Attachment is obsolete: true
(Reporter)

Comment 9

3 years ago
Created attachment 8678382 [details]
testcase 1 (two <progress> elements)
Created attachment 8678432 [details] [diff] [review]
Fix progress bar rendering on the Ambiance GTK3 theme.

The main issue here appears to be that the progress bar widget has the "trough" style class by default, which interferes with rendering expectations. Upstream GTK explicitly removes this style class before rendering a progress chunk (see gtkprogressbar.c). I've also added a call to gtk_render_frame to be consistent.

Lastly, this patch avoids drawing a progress bar chunk background on GTK versions before 3.13.7- older draw implementations didn't call it anyway. See GTK commit 6c06bd55dae61ce6066555c7d4794ed9ca3911de.

Thanks!
Attachment #8678432 - Flags: review?(karlt)
Attachment #8678432 - Flags: review?(karlt) → review+

Comment 12

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/41d905020339
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Duplicate of this bug: 1221498
Comment on attachment 8678432 [details] [diff] [review]
Fix progress bar rendering on the Ambiance GTK3 theme.

Approval Request Comment
[Feature/regressing bug #]: gtk3
[User impact if declined]: Progress bar sliders will be difficult to see on Ubuntu 15.04's default theme. 
[Describe test coverage new/current, TreeHerder]: This bug does not occur on test infrastructure, as the theme used on test slaves does not trigger this implementation bug.
[Risks and why]: No known risks.
[String/UUID change made/needed]: N/A
Attachment #8678432 - Flags: approval-mozilla-beta?
status-firefox43: --- → affected
Comment on attachment 8678432 [details] [diff] [review]
Fix progress bar rendering on the Ambiance GTK3 theme.

We need this on 44 also.

This is a small patch that makes a big difference to this widget, fixing bug 1221498 also.
Attachment #8678432 - Flags: approval-mozilla-aurora?
Comment on attachment 8678432 [details] [diff] [review]
Fix progress bar rendering on the Ambiance GTK3 theme.

GTK3 fix, approved for beta and aurora.
Attachment #8678432 - Flags: approval-mozilla-beta?
Attachment #8678432 - Flags: approval-mozilla-beta+
Attachment #8678432 - Flags: approval-mozilla-aurora?
Attachment #8678432 - Flags: approval-mozilla-aurora+

Comment 18

3 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/b50c13a2d7bb
status-firefox44: affected → fixed

Comment 19

3 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/51585d9e70eb
status-firefox43: affected → fixed
You need to log in before you can comment on or make changes to this bug.