System controls have too much horizontal padding on gtk, causing issues on websites. 
    Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: i.r.e.c.c.a.k.u.n+bugzilla.mozilla.org, Unassigned)
References
Details
Attachments
(5 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
Many of the websites using resized form controls. By default that controls renders with the system style and switches to the fallback when custom styles was applied.
But size changing doesn't counts as "styling" and this leads to broken controls appearance on some platforms, e.g. on Linux. Screenshots will be attached below.
Also I've made an interactive example where you can test: https://hanabishirecca.github.io/controls-example/
Resized system controls on Windows is ok because of small default size
Just for the comparison: WebKit doesn't has this issue at all, regardless of the platform
| Comment 4•5 years ago
           | ||
Hi,
Thanks for the details. I was able to reproduce on Ubuntu 18.04.3 LTS , on the following versions (chrome works fine, and ff in windows 10 pro works as well)
Latest Nightly 81.0a1 (2020-08-19) (64-bit)
Beta 80.0 (64-bit)
Release 79.0 (64-bit)
I will move this over to a component so developers can take a look over it. If is not the correct component please feel free to change it to an appropriate one.
Thanks for the report.
Best regards, Clara.
| Comment 5•5 years ago
           | ||
This is specific to your GTK theme (Adwaita, which has huge controls), which Firefox is respecting. Though I agree we should try to behave better here.
I don't think this title is fully describes the problem. Because this is the overall sizing issue and a lot of websites rely on default elements sizes. This can lead to real layout troubles. I think FF should strictly force sizes identical to "styled" ones, as Chrome does.
By the way, I'm not using Adwatia. My system controls look is different. Seems like FF doesn't really respects a system theme here.
| Comment 8•5 years ago
           | ||
Ah, so you're using a dark theme, and we block it for this precise kind of issue and fall back to adwaita. If you turn on widget.content.allow-gtk-dark-theme you should see the Arc-Dark buttons instead.
Oh, that makes sense now. So if a system theme can deform elements in the such way, change sizes and colors, I definitely think FF should strictly control this behavior and don't rely on any crazy values external theme can provide. Because this can break web layout very roughly.
| Comment 10•5 years ago
           | ||
Yeah, there are multiple reasons to drop the GTK theming for web content. Compat with websites that make assumptions about form controls is a big one. Also, as we become more multiprocess to mitigate spectre, we start running into X client connection limits (bug 1635451). And also it allows to sandbox web content even more.
The good thing is that given that, there's people working on it, and if you turn on widget.disable-native-theme-for-content, you can get a preview of the cross-platform theme that folks are working on :)
We can look into making the GTK code more resilient to this kind of stuff. Bug 1411425 would make this obsolete anyhow.
| Reporter | ||
| Comment 11•5 years ago
           | ||
Good to hear! The sad thing is, seems like it also breaks the layout. Even worse, it breaks the layout on Windows too 😬
| Comment 12•5 years ago
           | ||
Can you attach a test-case to the bug where it breaks? (That kind of thing is why it's not on by default yet)
Also, make sure to try it on Nightly, otherwise you won't have bug 1640195 (which made a huge refactoring of it).
| Reporter | ||
| Comment 13•5 years ago
           | ||
Oops, it already looks fine in 81 nightly. Even default background color became white as it should, not inheriting from a system theme.
So I think my bug report is kinda useless now. It turns just to a question "when internal theme will be enabled by default".
| Reporter | ||
| Comment 14•5 years ago
           | ||
| Reporter | ||
| Comment 15•4 years ago
           | ||
Well, in FF88 widget.disable-native-theme-for-content option doesn't work anymore.
But as I can see the new theme is now default in current nightly FF89. So I think this report can be closed now.
| Comment 16•4 years ago
           | ||
Yeah the pref was renamed to widget.non-native-theme.enabled.
 controls-linux.png
 controls-linux.png
            
Description
•