"Block web fonts" causes choppy scrolling on reddit.com
Source issue: https://github.com/mozilla-mobile/focus/issues/80
Example:
open reddit.com in firefox focus
pick a post with many comments
scrolling through posts is slightly choppy
disable blocking social trackers in settings
scrolling through posts is now completely smooth
I assume it is because there are lots of upvote / downvote reddit buttons everwhere. I have noticed this on other pages too
This bug appears when socal buttons are hidden and replaced with an [X] template icon instead. I think that you need to have fonts blocked too. When there is a page with lots of those placeholder [X]'s then scrolling becomes choppy. I would expect there to be no performance tradeoffs for such a funtion.
thanks
Pretty much just confirming the previous comment but I was able to reproduce by just blocking web fonts. STR:
- Settings -> Enable "Block Web Fonts" ("Block social trackers" seems irrelevant)
- Go to reddit.com
- Select post
- Wait for comments to load & Scroll
Notably, the footer on each post is replaced with an [X], which includes the upvote & downvote buttons/counts.
I was unable to reproduce the issue if I went to reddit, blocked web fonts, and reloaded the page (presumably because the web fonts are already cached).
Thanks for the tips, phunkular!
This seems to be caused by a .ttf font on the page – with "Block Web Fonts" enabled & I comment out this line, I can no longer reproduce the issue.
Notably, when commenting out .ttf fonts, the downvote buttons & friends are back.
EDIT: While using the dev tools, I noticed a .woff font is also downloaded - I wonder if it's a back-up font for the .ttf font I blocked. I'm not sure which is responsible for causing the slowdown.
I was able to reproduce this issue in Chrome via the devtools. Roughly:
- Open mobile chrome, go to a reddit page (I'm using this)
- Open Chrome dev tools -> click Remote Devices on the bottom, select your device (on the left), and click inspect for the reddit page
- Open the "Network pane" -> Click "Font"
- Reload the page to get web fonts to load
- Right-click on any loaded fonts, select "Block Request URL", & refresh the page to reload with request blocked
- Repeat previous step until no fonts are loaded.
- Try scrolling and see scrolling jank (you can disable the "Enable request blocking" checkbox & refresh to quickly compare the state of scrolling)
Edit: you can also reproduce this on desktop but the effects are not as extreme (presumably because of the increased processor speeds).
I filed https://bugs.chromium.org/p/chromium/issues/detail?id=740765 against the Chromium source.
To continue progress on this bug, I think we can do the following:
- Wait for a fix
- Wait for an analysis and, if no fix is coming, use the analysis to help us create a workaround
- Look for workarounds
One workaround could be to swap the reddit web-font with one we own. It might just work if the font file is blank but more likely, we'd have to replace the specific symbols they use with ones that don't cause the page to break (which sounds really fragile).
I don't know if it's worth prioritizing this until we get some further analysis from the Chromium team so I'm going to unassign.