Closed Bug 1913452 Opened 7 months ago Closed 6 months ago

Unnecessary scrollbar on new-tab page when browsing new-tab wallpapers

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

STR:

  1. (optional but helpful) Configure Firefox (or your OS) to get into "always show scrollbars" mode (i.e. turn off overlay scrollbars). On macOS and Windows 11, this is in your system settings; on Linux, you can toggle this in Firefox preferences with the "Always show scrollbars" checkbox.
  2. Open a new tab.
  3. Click the cog icon.
  4. Click "abstract" or "photographs".

ACTUAL RESULTS:
A new scrollbar appears that's nearly the height of the window. (This displays alongside the regular new-tab scrollbar, if you've got "always show scrollbars" enabled)

EXPECTED RESULTS:
No such scrollbar.

DIAGNOSIS:
Poking in devtools, I found the issue; we've got an element that's height: 100%, which also has margin-top and margin-bottom (both set to 16px), which makes it trivially overflow.

We should reduce the height to height: calc(100% - 32px) so that it exactly fills the containing block (without the margins making it overshoot). (Eventually we can make it height:stretch instead, but we don't have that syntax yet; that's bug 1789477.)

Relevant styles:
https://searchfox.org/mozilla-central/rev/2455e4d6388cbdeadb44b9633b971a65a98b504c/browser/components/newtab/css/activity-stream-linux.css#2083,2088,2092,2099

.wallpaper-list {
...
  margin: 16px 0;
...
.wallpaper-list.category {
...
  height: 100%;

Those decls are what give this element a margin-box height of 100%-plus-16px-plus-16px, which makes it overflow.

We should reduce the height to height: calc(100% - 32px)

Strictly speaking, the scrollbar goes away if I use calc(100% - 16px) -- I suspect the bottom 16px doesn't matter here because it doesn't create scrollable overflow. But we should still probably subtract 32px for robustness; it's not great to be needlessly pushing a margin off the bottom of the scrollport.

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Summary: Unnecessary scrollbar on new-tab page when browsing new-tab backgrounds → Unnecessary scrollbar on new-tab page when browsing new-tab wallpapers
See Also: → 1913513
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a3ba31184e36 Account for margin when sizing new-tab's wallpaper list to 100% height, to avoid unnecessary scrollbar. r=home-newtab-reviewers,desktop-theme-reviewers,sfoster,maxx
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: