Closed Bug 1197165 Opened 9 years ago Closed 8 years ago

Invisible html hint in firefox developer

Categories

(Core :: Widget: Gtk, defect)

42 Branch
x86_64
Linux
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla47
Tracking Status
firefox46 --- verified
firefox47 --- verified

People

(Reporter: matheuspfaustino, Assigned: karlt)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(7 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20150821004008

Steps to reproduce:

Just points your mouse in a tab and wait to it shows your whole text in a hint.



Actual results:

It'll show your content in a, almost, invisible hint, without a background.


Expected results:

The background should not be transparent.
Severity: normal → major
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
I'm using Numix-Frost as GTK theme.
Gtk3?
Component: Untriaged → Widget: Gtk
Product: Firefox → Core
GTK+ 3.16.6
Blocks: ship-gtk3
A few questions;

- Does this happen with the classic (non-developer) theme?
- What do tooltips look like in other GTK3 applications with your theme?

Thanks!
Flags: needinfo?(matheuspfaustino)
Sorry for the delay.

1. Yes
2. I'm attaching images from that
Flags: needinfo?(matheuspfaustino)
Attached image Without Dev theme (deleted) —
Attachment #8653446 - Attachment description: Screenshot from 2015-08-27 09-13-32.png → Without Dev theme
Attached image Without dev theme (tab) (deleted) —
Attachment #8653452 - Attachment description: Without → Without dev theme (tab)
Attached image With a custom theme (deleted) —
Attached image system's tooltip (deleted) —
Attached image system's tooltip in thunderbird (deleted) —
Not able to reproduce this with default theme, so I am not sure this should be categorized as a blocker to shipping GTK3. Removing the block for now until we can get confirmation that this is not just a problem with the theme.
No longer blocks: ship-gtk3
Whiteboard: [gfx-noted]
I don't know if it could be help, but I'm using antergos distro in my pc.
I tested now and in live cd, it's happening yet.
Found the offending line of CSS in the Numix-Frost theme;

>.tooltip * {
>    background-color: transparent;
>}

This appears to be set to make all children of tooltips have a transparent background. I'm not sure how we're triggering this, though...
Confirmed for me. 
Using the  Clearlooks-Phenix theme: commenting out those lines the problem doesn't occur.
I've got the same issue (and same CSS declaration) in Greybird theme and Zukitwo theme; firefox-45.0_beta8 wa the last version I tested.  

The aim with this in the themes *seems* to be to remove background from all tooltip contents so that the background of the tooltip itself renders unhindered.  I've no idea why this doesn't work in firefox given it works very well in my other gtk3 apps and the border and other elements seem to render just fine.

I've hacked my themes in the meantime to assign the same background property as is assigned to .tooltip for now, just so i can read the things.  However it's worth noting that by doing this the border and potentially other eyecandy doesn't show up on the tooltip anymore.  Is it possible that firefox isn't actually rendering the base tooltip container but instead just the tooltip content?
(In reply to Ian Stakenvicius from comment #16)
> Is it possible that
> firefox isn't actually rendering the base tooltip container but instead just
> the tooltip content?

It's possible that there is something else that Gecko should be drawing, but
it is trying to draw the tooltip background.

I wonder whether the gtk_widget_set_name(widget, "MozillaGtkWidget") is
causing a failure to match.  Might be worth trying removing that.

https://dxr.mozilla.org/mozilla-central/rev/d848a5628d801a460a7244cbcdea22d328d8b310/widget/gtk/gtk3drawing.c#513

The code to draw the background tries to mimic what GTK does.  It's possible
that is not quite the same.

https://dxr.mozilla.org/mozilla-central/rev/d848a5628d801a460a7244cbcdea22d328d8b310/widget/gtk/gtk3drawing.c#1940
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → karlt
This is consistent with gtktooltip.c.

gtk_style_context_save() modifies the CSS node hierarchy causing this rule to
incorrectly match:

.tooltip * {
        background-color: transparent;
}

See also https://bugzilla.gnome.org/show_bug.cgi?id=761870#c2

Review commit: https://reviewboard.mozilla.org/r/37769/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/37769/
Attachment #8726033 - Flags: review?(andrew)
Attachment #8726033 - Flags: review?(andrew) → review+
Comment on attachment 8726033 [details]
MozReview Request: bug 1197165 apply tooltip style class when creating window instead of when drawing r?acomminos

https://reviewboard.mozilla.org/r/37769/#review34309

LGTM.

It might be interesting to see how similar selectors affect other widgets with gtk_style_context_save.
https://hg.mozilla.org/mozilla-central/rev/fe3b0ce3a5fe
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Works great here -- any chance it can make it into firefox-45 prior to release?
Thanks for the feedback.  No chance of this getting into 45, sorry, but only distro builds will have --enable-default-toolkit=cairo-gtk3, so there is the option for distibutions to add the patch if building this way.
Comment on attachment 8726033 [details]
MozReview Request: bug 1197165 apply tooltip style class when creating window instead of when drawing r?acomminos

Approval Request Comment for 46
[Feature/regressing bug #]: bug 627699
[User impact if declined]: hard or impossible to read tooltips with some GTK themes.
[Describe test coverage new/current, TreeHerder]: none.
[Risks and why]: low risk.
The patch changes the code to be similar to GTK versions 3.6 and newer.
GTK version 3.4 (year 2012) had similar code to what is removed here, so there is a small chance that some theme was depending on the quirks of that code.  However, I think that is unlikely as the quirks were unexpected and not documented so it would be dangerous for any theme to depend on theme.  I also can't think of any reason for themes to want to use them.
[String/UUID change made/needed]: none.
Attachment #8726033 - Flags: approval-mozilla-beta?
Blocks: gtk3, ship-gtk3
Blocks: 1250704
Marking affected for 46 since we intend to ship gtk in 46
Comment on attachment 8726033 [details]
MozReview Request: bug 1197165 apply tooltip style class when creating window instead of when drawing r?acomminos

OK to uplift to beta, fix for theme readability
Attachment #8726033 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [good first verify]
Verified as fixed in Firefox Developer Editor 47.0a2 (2016-03-16) Debian 8 GNU/Linux 

Verified as fixed in Firefox Beta 46.0b1 Debian 8 GNU/Linux
Status: RESOLVED → VERIFIED
QA Whiteboard: [good first verify] → [good first verify][bugday-20160316]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: