Excessive tab height when displaying page titles including Unicode math symbols
Categories
(Firefox :: Tabbed Browser, defect, P2)
Tracking
()
People
(Reporter: joaquim.monteiro, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
(Whiteboard: [proton-tabs-bar] [priority:2c])
Attachments
(6 files)
166.23 KB,
image/png
|
Details | |
13.04 KB,
image/png
|
Details | |
104 bytes,
text/html;charset=utf-8
|
Details | |
21.13 KB,
text/plain
|
Details | |
100.42 KB,
text/plain
|
Details | |
48 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-release+
jcristau
:
approval-mozilla-esr91+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0
Steps to reproduce:
Opened a web page composed of the following HTML code (the title was originally found in a YouTube video):
<html>
<head>
<title>𝗧𝗛𝗘 𝗜𝗡𝗖𝗜𝗗𝗘𝗡𝗧 - YouTube</title>
</head>
</html>
Note: I tested it on a clean profile, and it still happens.
Actual results:
The tab bar became much taller than required to show the title. (see attached screenshot)
Expected results:
The tab bar staying the same size, as no additional height is required to display the title.
Reporter | ||
Updated•4 years ago
|
Comment 1•4 years ago
|
||
If you're as confused as me, those are UNICODE math symbols
https://www.utf8-chartable.de/unicode-utf8-table.pl?start=120276&number=128
Which version of Firefox (date) and OS are you using (from about:support)? I can't reproduce it on macOS 20210410214333.
Reporter | ||
Comment 2•4 years ago
|
||
(In reply to Francesco Lodolo [:flod] from comment #1)
Which version of Firefox (date) and OS are you using (from about:support)? I can't reproduce it on macOS 20210410214333.
This is the 2021-04-11 nightly (build ID 20210411093417). It didn't appear in this version though, earlier nightlies had the same issue.
about:config reports my OS as "Linux 5.11.12-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 07 Apr 2021 21:48:33 +0000". I can add that it's Arch Linux with the Sway window manager (I'm using Wayland).
It's possible that it's a font issue, I have Noto Sans as the default font.
Reporter | ||
Comment 3•4 years ago
|
||
Just tested under KDE instead of Sway, same thing. Also, it seems to also happen when the page is suggested in the address bar (see screenshot).
Reporter | ||
Comment 4•4 years ago
|
||
Comment 5•4 years ago
|
||
(In reply to Joaquim Monteiro from comment #2)
It's possible that it's a font issue, I have Noto Sans as the default font.
What happens if you change it?
Reporter | ||
Comment 6•4 years ago
|
||
(In reply to Francesco Lodolo [:flod] from comment #5)
(In reply to Joaquim Monteiro from comment #2)
It's possible that it's a font issue, I have Noto Sans as the default font.
What happens if you change it?
Changing it to DejaVu Sans fixes the issue. I also tried Droid Sans, and the issue still occurs with it.
I've also noticed that if, with Firefox closed, I open the page directly (by double-clicking on the file), the issue does not occur until I refresh the page or open it in another tab by double-clicking it again.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 9•4 years ago
|
||
(In reply to Joaquim Monteiro from comment #6)
I've also noticed that if, with Firefox closed, I open the page directly (by double-clicking on the file), the issue does not occur until I refresh the page or open it in another tab by double-clicking it again.
This sounds pretty wonky. Jonathan, do you have any inkling of how this would happen? I assume it's something to do with font metrics but I don't know what else is involved here.
Assignee | ||
Comment 10•4 years ago
|
||
The text there is not using normal Latin-script letters, it's using characters from the Mathematical Sans-serif Bold block in Unicode's supplementary plane (around U+1D5xx). As such, the characters aren't supported by most normal text fonts, they're generally only found in specialized fonts designed for mathematical typography. So when they occur in the title, Firefox can't draw them using the normal user interface font; instead, fallback comes into play and it searches for some other font that actually supports these characters.
Math symbol fonts, though, often have much larger line metrics than regular text fonts, to allow for the wide range of symbols of various sizes that may occur. And so if the element is using auto sizing rather than an explicitly fixed height, it may grow much larger than expected. (And if the height were fixed, it's possible the baseline of the text would be pushed much too low because of the large metrics of the math font.)
Changing the default font to DejaVu Sans presumably fixed the problem because DejaVu (unlike most text fonts) does support a bunch of these supplementary math characters, and so fallback didn't need to happen.
I'm guessing that the odd situation where the issue didn't occur on initial display but appeared later probably relates to asynchronous font fallback, where at the time the initial reflow happened, we hadn't yet figured out what font we could use for this text, and so the element got sized based on the default font; but once enough font data has been loaded to actually handle these characters, we use the associated metrics and you get the taller element.
Updated•4 years ago
|
Comment 14•4 years ago
|
||
I just tried it with a video with only ascii characters, it still happens. I use "System San Francisco" as my system font, I'll try changing to something more common to see if the issue persists.
I use Firefox Developer Edition under Arch Linux with i3 window manager
Comment 16•4 years ago
|
||
I have attached the test case in comment 0 for easier investigation on different systems.
Comment 17•4 years ago
|
||
I have attempted reproducing this issue, but I was unsuccessful. I have attempted reproducing in Ubuntu 20 with i3, Ubuntu 20 with Sway, Fedora 33 with Wayland on all the latest versions of the main channels. I also attempted changing the system font as discussed in the other bug, but I was still unsuccessful. (I have to mention that I don't know how to change the system font on i3 and sway window managers, only on stock ubuntu 20)
I have to mention that I do not know what I am missing from reproducing it.
Can you provide me with the correct way to change system fonts in any Linux distributions?
Do you have any idea what I could be missing from my configuration?
Thank you!
Reporter | ||
Comment 18•4 years ago
|
||
(In reply to Bodea Daniel [:danibodea] from comment #17)
I have attempted reproducing this issue, but I was unsuccessful. I have attempted reproducing in Ubuntu 20 with i3, Ubuntu 20 with Sway, Fedora 33 with Wayland on all the latest versions of the main channels. I also attempted changing the system font as discussed in the other bug, but I was still unsuccessful. (I have to mention that I don't know how to change the system font on i3 and sway window managers, only on stock ubuntu 20)
I have to mention that I do not know what I am missing from reproducing it.
Can you provide me with the correct way to change system fonts in any Linux distributions?
Do you have any idea what I could be missing from my configuration?Thank you!
The proper way is to edit the ~/.config/gtk-3.0/settings.ini
file, changing the gtk-font-name
to the font you want to test. If the font settings aren't applied (or if you want to change fonts temporarily), use gsettings to do so, by running gsettings set org.gnome.desktop.interface font-name "Droid Sans Regular 10"
, for example.
Comment 19•4 years ago
|
||
As a "me too", I've been seeing this on Arch Linux using GNOME with the default fonts (Cantarell Regular 11 for "interface text" and Cantarell Bold 11 for "legacy window titles" and DejaVu Sans Serif 16 in Firefox). I have a huge number of tabs in my session and I don't know if or whether one of them causes this. It shows up like this right from the start most of the time, but not always. For what it's worth, I'm also using Auto Tab Suspend, which adds a 💤 character before the title of the suspended tabs.
Comment 20•4 years ago
|
||
I'm affected by this bug on Arch Linux with KDE (Firefox 89.0).
Using DejaVu Sans as my system and Firefox font.
Testcases are either of these two youtube videos:
https://www.youtube.com/watch?v=JUoqpLnjB74
https://www.youtube.com/watch?v=wg3ZXFthmg8
Comment 22•4 years ago
|
||
Same issue here, on Firefox 89.0 with DejaVu Sans Serif 16. I first came across the bug on this page: https://twitter.com/AvisPhotoshops/status/1400513072628895746.
Comment 24•4 years ago
|
||
Three comments above I wasn't sure why it only happened sometimes, but I realized that toggling between the maximized and restored states reproduces the issue.
And I think it's a regression, but I don't see a bisection here.
Comment 25•4 years ago
|
||
Same thing here. https://developer.elementary.io/ triggers the same behavior to me.
Comment 27•4 years ago
|
||
Some additional info:
- I can reproduce it with Unicode U+2A00 character ⨀
- I resolved by change my font form "Inter Regular" to "Sans Regular" in /gnome tweaks/interface text
Updated•4 years ago
|
Updated•4 years ago
|
Comment 32•4 years ago
|
||
Comment 33•4 years ago
|
||
Other than the fact that the date doesn't match up, at least the two commits identified by bisect are both fonts related....
Comment 34•4 years ago
|
||
I assume those just changed what font are used in the tab title. Is there a way for me to figure out which font is actually used there and force that during the bisect process?
Assignee | ||
Comment 35•4 years ago
|
||
Bug 1714762 made it more likely that Noto Sans Symbols will be used as a fallback for characters that aren't present in the main font being used; that font has a larger-than-typical height (in order to accommodate some symbols that are particularly tall and/or deep, presumably), and that'll be what is affecting the tab height.
I'm surprised the tabs haven't been given an explicitly-specified height, though. Leaving them to auto-size themselves to their content seems like it will always carry the risk of odd discrepancies happening, depending on the particular fonts that happen to be available and the characters that occur in the page titles.
Comment 36•4 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #35)
I'm surprised the tabs haven't been given an explicitly-specified height, though.
The font-size is not known ahead of time, nor is the font family (both come from the OS preferences), so the line height in px is not known, so doing this is... not straightforward. Do you have suggestions for how such a height should be determined?
Assignee | ||
Comment 37•4 years ago
|
||
Presumably the height could be specified in em
units, so that it would adapt itself to the font size being used (but would be independent of the metrics of any fallbacks that might happen to get used for "weird" characters).
Assignee | ||
Comment 38•4 years ago
|
||
(I'm assuming that in the unlikely event that a page title really does contain exceptionally tall/deep characters, it's better from a design-stability point of view to let it be clipped than to arbitrarily let the tab grow to accommodate it.)
Comment 42•4 years ago
|
||
By the way, this also happens for the urlbar dropdown list and tab tooltips.
The character for me is 𝑽 and rendered font is Latin Modern Math but the OS actually prefers DejaVu Math TeX Gyre or DejaVu Serif. In web content it uses DejaVu Serif so it's fine.
Comment 43•4 years ago
|
||
Can reproduce on this YT link using 89.0.2 (64-bit) Firefox for Arch Linux. It has "𝘀𝘁𝗶𝗺𝘂𝗹𝗮𝘁𝗲 𝘆𝗼𝘂𝗿 𝘀𝗲𝗻𝘀𝗲𝘀" in the title
Comment 44•4 years ago
|
||
(In reply to lilydjwg from comment #42)
By the way, this also happens for the urlbar dropdown list and tab tooltips.
Please file a separate bug for this. Any fix we apply here is unlikely to affect the URL bar dropdown and/or tooltips.
Comment 45•4 years ago
|
||
(In reply to :Gijs (he/him) from comment #44)
Please file a separate bug for this. Any fix we apply here is unlikely to affect the URL bar dropdown and/or tooltips.
Done as bug 1719436.
Comment 46•4 years ago
|
||
Adding the following to userChrome.css
serves as a workaround until this is fixed:
.tab-label {
line-height: 1em;
}
Updated•4 years ago
|
Comment 48•4 years ago
|
||
I tried to reproduce this on Ubuntu 19.10 with the Droid Sans font installed from https://www.fontsquirrel.com/fonts/droid-sans, creating a settings.ini file per comment 18 and restarting my system but I couldn't reproduce any odd tab shape sizes.
Did I install the wrong font? I couldn't reproduce it before installing the font either.
I expect comment 46 to be close to what we want, maybe: line-height: 1.2em; max-height: 1.2em; overflow: clip;
but without testing it I can't confirm. We will also want to make sure that the overall tab height is unchanged from the current design.
Assignee | ||
Comment 49•4 years ago
|
||
Do you have Latin Modern Math installed? If not, you may need to add it -- I think that's what font fallback is finding in the problem cases. (The relevance of the font chosen in the gtk settings is that it should not include the Unicode math symbols, so that font fallback comes into play.)
Assignee | ||
Comment 51•4 years ago
|
||
:jaws, according to discussion in bug 1719953 it sounds like reproducing this may be dependent on having an older version (v1.958) of Latin Modern Math installed.
This is available directly from the font developers at http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1958.zip. Only the newer v1.959 is listed on the downloads page, but it turns out the older .zip is still present on the server.
Comment 53•4 years ago
|
||
Comment 54•4 years ago
|
||
I don't seem to have such a font installed. Here's my fc-list
:
Assignee | ||
Comment 55•4 years ago
|
||
It looks like you have a bunch of LatinModernMath-related fonts that are part of the MathJax package; I suspect one or more of these is probably involved in the issue here.
Comment 57•4 years ago
|
||
Those are provided by mathjax2 - 2.7.9.
I can provide a full list of all my system packages and their versions if that helps reproduction. Honestly, if there's any app to automate VM creation, I can try and create a reproduction setup (if so far reproduction is the issue).
Assignee | ||
Comment 58•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 59•4 years ago
|
||
I was able to reproduce this on Ubuntu 20.04LTS after installing the older version of Latin Modern Math, per comment 51. Checked that setting line-height: 1.2
on the label fixes the issue here (and does not affect the rendering of "normal" titles at all).
Assignee | ||
Comment 60•4 years ago
|
||
(Using 1em
as suggested in comment 46 would actually tighten the spacing slightly when second-line text such as PLAYING is present, so 1.2
is a better value to use here; it more closely reflects what normal
computes to for typical user-interface fonts.)
Comment 61•4 years ago
|
||
Using 1em
as I mentioned before does have caveats.
For my font (Cantarell), the bottom part of letters like "g" is trimmed. (e.g.: the part of letters that goes under the baseline. I'm sure that has a name).
With line-height: 1.2;
this is still an issue, but with line-height: 1.3;
it's not.
Assignee | ||
Comment 62•4 years ago
|
||
(That's called the "descender".)
Using 1.3 rather than 1.2 would certainly reduce the risk of clipping any of the glyphs. But at least when testing with the default Ubuntu UI font, I'm seeing that using 1.3 here causes the secondary tab label text (e.g. PLAYING), when present, to move down by 1 pixel from its current position. (The overall tab height doesn't change; just that second line of text shifts slightly lower within it.)
Personally, I think that still looks OK, and I'd be fine with using 1.3, but I'm not responsible for the design here; I think we need to hear from :jaws or others on the front-end team.
Assignee | ||
Comment 63•4 years ago
|
||
One other thing: note that there are other UI elements that are similarly affected, in particular entries in the URLbar dropdown (that's on file as bug 1671525) but also the tooltip that appears when you hover over such a tab. So a comparable fix should be applied to those as well, I think, but I'm not sure offhand where all the relevant CSS lives...
Updated•4 years ago
|
Comment 66•4 years ago
|
||
Comment 67•4 years ago
|
||
bugherder |
Updated•3 years ago
|
Comment 68•3 years ago
|
||
Is this going to be uplifted to ESR91?
Comment 70•3 years ago
|
||
[Tracking Requested - why for this release]:
Updated•3 years ago
|
Comment 72•3 years ago
|
||
Please nominate this for ESR91 approval when you get a chance.
Assignee | ||
Comment 74•3 years ago
|
||
Comment on attachment 9231908 [details]
Bug 1704404 - Apply an explicit line-height to tab labels, in case the title uses fallback fonts with excessive ascent/descent metrics. r?jaws
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Cosmetic but glaring UI issue with lots of dupes being reported
- User impact if declined: UI layout occasionally gets disrupted - tabs may become much too tall, depending on title text and installed fonts
- Fix Landed on Version: 92
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Narrowly-targeted CSS-only fix for tab sizing
- String or UUID changes made by this patch:
Comment 75•3 years ago
|
||
Comment on attachment 9231908 [details]
Bug 1704404 - Apply an explicit line-height to tab labels, in case the title uses fallback fonts with excessive ascent/descent metrics. r?jaws
approved for 91.1esr
Comment 76•3 years ago
|
||
Given the volume of dupes and the low risk of the fix, I think we should have this on the radar for a 91 dot release too. Please nominate for release approval when you get a chance (no need to fill out the form again).
Comment 77•3 years ago
|
||
bugherder uplift |
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 80•3 years ago
|
||
I've had difficulty reproducing this issue in the first place.
Joaquim Monteiro, would you verify this fix on your end?
It appears to be fixed in:
- Beta 92 (download link)[http://archive.mozilla.org/pub/firefox/releases/92.0b4/linux-x86_64/en-US/firefox-92.0b4.tar.bz2]
- ESR 91 (download link)[http://archive.mozilla.org/pub/firefox/releases/91.0esr/linux-x86_64/en-US/firefox-91.0esr.tar.bz2]
Al you need to do is set the system as initially had when the issue initially reproduced, download these 2 builds, run them and attempt reproduction.
Thank you for your contribution!
Comment 81•3 years ago
|
||
Comment on attachment 9231908 [details]
Bug 1704404 - Apply an explicit line-height to tab labels, in case the title uses fallback fonts with excessive ascent/descent metrics. r?jaws
approved for 91.0.1 (release + esr)
Updated•3 years ago
|
Comment 82•3 years ago
|
||
bugherder uplift |
Comment 83•3 years ago
|
||
uplift |
for 91.0.1esr (FIREFOX_ESR_91_0_X_RELBRANCH):
https://hg.mozilla.org/releases/mozilla-esr91/rev/b5dd294ee5058f0ac8b3fa5c5cb236d6c5d5f762
Comment 84•3 years ago
|
||
Added to the 91.0.1 release notes:
Fixed an issue causing buttons on the tab bar to be resized when loading certain websites
Reporter | ||
Comment 85•3 years ago
|
||
(In reply to Bodea Daniel [:danibodea] from comment #80)
I've had difficulty reproducing this issue in the first place.
Joaquim Monteiro, would you verify this fix on your end?
It appears to be fixed in:
- Beta 92 (download link)[http://archive.mozilla.org/pub/firefox/releases/92.0b4/linux-x86_64/en-US/firefox-92.0b4.tar.bz2]
- ESR 91 (download link)[http://archive.mozilla.org/pub/firefox/releases/91.0esr/linux-x86_64/en-US/firefox-91.0esr.tar.bz2]
Al you need to do is set the system as initially had when the issue initially reproduced, download these 2 builds, run them and attempt reproduction.
Thank you for your contribution!
The issue has been fixed since da82969d4cf5 landed on nightly. I can confirm it's also fixed in the 92.0b4 release you linked.
ESR 91 still has the issue, which is to be expected since it didn't receive the fix. In ESR 91.0.1 (which does have the fix applied), the problem is fixed.
Comment 86•3 years ago
|
||
Yes, that's right. Sorry to have provided the wrong build for ESR.
Thank you for verification in Nightly 93.0.a1, Beta v92.0b4 and ESR 91.0.1 and for the fast reply!
Would you kindly also verify the fix in Release 91.0.1?
Reporter | ||
Comment 87•3 years ago
|
||
(In reply to Bodea Daniel [:danibodea] from comment #86)
Yes, that's right. Sorry to have provided the wrong build for ESR.
Thank you for verification in Nightly 93.0.a1, Beta v92.0b4 and ESR 91.0.1 and for the fast reply!Would you kindly also verify the fix in Release 91.0.1?
I can confirm it's fixed in 91.0.1 too.
Comment 88•3 years ago
|
||
Thanks Joaquim!
Comment 89•3 years ago
|
||
I can confirm 91.0.1 fixed the address bar, but there are a number of outstanding locations with this issue (address bar suggestions, tab tooltips, history tooltips).
I've filed another bug for these remaining issues
Comment 90•3 years ago
|
||
(In reply to tony from comment #89)
I can confirm 91.0.1 fixed the address bar, but there are a number of outstanding locations with this issue (address bar suggestions, tab tooltips, history tooltips).
I've filed another bug for these remaining issues
Fixed the tab bar* to clarify
Description
•