Closed Bug 1278108 Opened 8 years ago Closed 8 years ago

<input type="range"> does not display on Firefox 46 with GTK+ 3.20

Categories

(Core :: Widget: Gtk, defect)

46 Branch
All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: c3526836, Assigned: stransky)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

(Keywords: html5, platform)

Attachments

(2 files, 3 obsolete files)

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

Steps to reproduce:

Load any page with an <input type="range"> slider element, on an Archlinux system with default theming (Adwaita?).


Actual results:

Element space is consumed, but nothing but transparency is drawn instead.

Although when you click on the element in order to create focus, an outline is visible (see screenshot).


Expected results:

A slider element should have been visible and usable.
Not that I could see and use this element normally in previous versions.
OS: Unspecified → Linux
Hardware: Unspecified → All
Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Keywords: inputmethod
Blocks: gtk-3.20
>Not that I could see and use this element normally in previous versions.

Note that*
yes I see that.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8760058 - Attachment description: test page with focus on range element.png → screenshot of test with focus on range element
The GtkScale seems to have a quite complicated CSS scheme:
https://developer.gnome.org/gtk3/stable/GtkScale.html

We may need to find some subset which needs to be implemented by Gecko.
(In reply to Martin Stránský from comment #7)
> The GtkScale seems to have a quite complicated CSS scheme:
> https://developer.gnome.org/gtk3/stable/GtkScale.html
> 
> We may need to find some subset which needs to be implemented by Gecko.

Yes. AFAIK we don't need the marks, value, or fill.
has-origin defaults to true, so maybe highlight should be drawn.
I don't think we have in the past though, so that may be an existing issue.
The range itself can be rendered quite easily - we just need to use nodes like we do with scrollbars. 

A different part is to render it correctly - as Gtk does that. The thumb uses negative margin and overlaps the through in Adwaita style and size of the through itself is difficult to get - I didn't find a way how to derive it.
Attached patch patch (obsolete) — Splinter Review
There's a basic patch for it. The scale is not rendered as well as native scales in gtk3.20 (it's a bit bigger) but it's the best I can produce now. We may also fix focus ring of the whole element (or don't draw it and draw only focus around the track).
Attachment #8763063 - Flags: feedback?(karlt)
Comment on attachment 8763063 [details] [diff] [review]
patch

The focus is rendered twice. Once in moz_gtk_scale_paint() around the track (the small one) and there's also big focus around whole element - I have no idea where it comes from.
This does not fix the issue with Gtk 3.18.9 under fedora23.
(In reply to Bill Gianopoulos [:WG9s] from comment #12)
> This does not fix the issue with Gtk 3.18.9 under fedora23.

That's possible, I target it to 3.20.
I did just read back and the original reporter did say he does not know of any previous version where this ever worked, so fixing it for the new stuff might be sufficient.  I thought this was a regression.  I am doing a gtk2 build to run this testcase against.
(In reply to Martin Stránský from comment #13)
> (In reply to Bill Gianopoulos [:WG9s] from comment #12)
> > This does not fix the issue with Gtk 3.18.9 under fedora23.
> 
> That's possible, I target it to 3.20.

These are the errors I get under gtk2.18:

(firefox:2728): Gtk-CRITICAL **: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(firefox:2728): Gtk-CRITICAL **: gtk_style_context_get_state: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

(firefox:2728): Gtk-CRITICAL **: gtk_style_context_get_direction: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

(firefox:2728): Gtk-CRITICAL **: gtk_render_slider: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed
(In reply to Bill Gianopoulos [:WG9s] from comment #15)
> (In reply to Martin Stránský from comment #13)
> > (In reply to Bill Gianopoulos [:WG9s] from comment #12)
> > > This does not fix the issue with Gtk 3.18.9 under fedora23.
> > 
> > That's possible, I target it to 3.20.
> 
> These are the errors I get under gtk2.18:

I meant gtk3.18.
(In reply to Bill Gianopoulos [:WG9s] from comment #14)
> I did just read back and the original reporter did say he does not know of
> any previous version where this ever worked, so fixing it for the new stuff
> might be sufficient.  I thought this was a regression.  I am doing a gtk2
> build to run this testcase against.

OK.  It took some doing because bug 1278236 broke building with the cairo-gtk2 toolkit.  But, I finally got a gtk2 build to work and this does work under gtk2, so it is a valid regression bug.
(In reply to Bill Gianopoulos [:WG9s] from comment #16)
> (In reply to Bill Gianopoulos [:WG9s] from comment #15)
> > (In reply to Martin Stránský from comment #13)
> > > (In reply to Bill Gianopoulos [:WG9s] from comment #12)
> > > > This does not fix the issue with Gtk 3.18.9 under fedora23.
> > > 
> > > That's possible, I target it to 3.20.
> > 
> > These are the errors I get under gtk2.18:
> 
> I meant gtk3.18.

I also have an old 32-bit laptop that does not have enough memory to run Gnome3 so I am running fedora24 mate-compiz spin on that using the BlueMenta theme.  This patch does not work for that case either.
Attachment #8763063 - Flags: feedback?(karlt)
Attached patch patch (obsolete) — Splinter Review
Fixed one, works also on pre3.20.
Attachment #8763063 - Attachment is obsolete: true
Attachment #8764902 - Flags: review?(karlt)
Attached patch Same patch, just fixing bitrot (obsolete) — Splinter Review
Nothing new here.  Just updating so it applies on current mozilla-central.
(In reply to Bill Gianopoulos [:WG9s] from comment #22)
> Created attachment 8776271 [details] [diff] [review]
> Same patch, just fixing bitrot
> 
> Nothing new here.  Just updating so it applies on current mozilla-central.

I give up on trying to keep patches here able to apply.  Builds including this patch are available at http://www.wg9s.com/mozilla/firefox/ and the patch I ma using which applies at current trunk will be available here http://www.wg9s.com/mozilla/firefox/patches/scale.patch
Summary: <input type="range"> does not display on Firefox 46 with GTK+ → <input type="range"> does not display on Firefox 46 with GTK+ 3.20
Comment on attachment 8764902 [details] [diff] [review]
patch

Looks good, thanks.

> moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width,

>+  WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ?
>+                           MOZ_GTK_SCALE_HORIZONTAL :
>+                           MOZ_GTK_SCALE_VERTICAL;

>+      GtkStyleContext* style = ClaimStyleContext(widget);
>+      gtk_style_context_get(style, gtk_style_context_get_state(style),
>+                            "min-width", scale_width,
>+                            "min-height", scale_height,
>+                            nullptr);
>+      ReleaseStyleContext(style);

I suspect the trough, and maybe even the slider should also be considered
here, but what you have here should work for Adwaita, so let's go with what
you have for now at least.
Attachment #8764902 - Flags: review?(karlt) → review+
Attachment #8776271 - Attachment is obsolete: true
Attachment #8764902 - Attachment is obsolete: true
Assignee: nobody → stransky
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef6de41494f3
Implement <input type="range"> on gtk 3.20. r=karlt
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/ef6de41494f3
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
could you please backport this to 48–50? it’s pretty bad to be unable to see UI elements…
(In reply to flying sheep from comment #29)
> could you please backport this to 48–50? it’s pretty bad to be unable to see
> UI elements…

Is there any real website which uses that range UI element? Maybe some router admin UI something?
It's a regression bug, not a feature request, so why shouldn't it be in a bugfix release?
It's a regression in GTK, not a regression in Firefox.

Uplifting workarounds for GTK regressions are evaluated based on the need and difficultly.
Keywords: regression
This takes the sting off it, true. We can't be expected to work around other products’ breakages the week they occur in.

But even without putting it into the current version, Firefox 51 is something I'd expect a new feature to end up in, not a fix.

A HTML 5 element not being usable on Linux until 2017-01-24 is pretty bad.
(In reply to flying sheep from comment #33)
> This takes the sting off it, true. We can't be expected to work around other
> products’ breakages the week they occur in.
> 
> But even without putting it into the current version, Firefox 51 is
> something I'd expect a new feature to end up in, not a fix.
> 
> A HTML 5 element not being usable on Linux until 2017-01-24 is pretty bad.

Well this dialog really does not belong int he bug, but it would seem to me there are 2 classes of Linux users, those who run nightlies and this is fixed, and those who run the provided by their linux distro in which case you should go through them to add this patch to the version they distribute.
Depends on: 1340048
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: