Closed Bug 1656786 Opened 5 years ago Closed 5 years ago

<select> list with more <option> elements than list size not scrollable anymore

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- unaffected
firefox81 --- fixed

People

(Reporter: aryx, Assigned: MatsPalmgren_bugz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Firefox Nightly 81.0a1 20200802093514 on Windows 8.1

<select> lists with more <option> elements than list size are not scrollable anymore

Example: 'Product' list at https://bugzilla.mozilla.org/query.cgi?format=advanced

Flags: needinfo?(mats)
Assignee: nobody → mats

FYI, only mouse-scrolling is broken - scrolling using the keyboard works fine...

So, the issue seems to be that ScrollFrameHelper::WantAsyncScroll() depends on the style NOT being hidden to be "scrollable":
https://searchfox.org/mozilla-central/rev/72a1334982cadde0ca8b3d3583877afea80f5639/layout/generic/nsGfxScrollFrame.cpp#1477-1480
GetScrollStylesFromFrame() used to return the unmodified CSS style, but now (bug 1531609) we map it to auto/hidden/scroll:
https://searchfox.org/mozilla-central/rev/72a1334982cadde0ca8b3d3583877afea80f5639/layout/generic/nsGfxScrollFrame.cpp#4318-4319
and <select> has overflow:clip:
https://searchfox.org/mozilla-central/rev/72a1334982cadde0ca8b3d3583877afea80f5639/layout/style/res/forms.css#231
which maps to hidden:
https://searchfox.org/mozilla-central/rev/72a1334982cadde0ca8b3d3583877afea80f5639/layout/base/ScrollStyles.cpp#20-21

I can't say I really understand the logic behind treating hidden has "unscrollable" in ScrollFrameHelper::WantAsyncScroll() - why does it do that? (hidden is scrollable (by script) per the CSS spec and always has been...)

It makes no sense to me that GetScrollStylesFromFrame() should return anything but auto/hidden/scroll given that this is a scroll frame!

Flags: needinfo?(mats)

While overflow: hidden is scrollable, it's not scrollable by the user... It seems also wrong to show scrollbars for something with overflow: clip. Maybe we should have overflow: auto in the listbox rules in forms.css?

Yes, I clarified my comment above. What seems odd to me that ScrollFrameHelper::WantAsyncScroll would check the style at all since if you have a scroll frame it can be scrolled in one way or another... But I guess its real semantics is "CanBeScrolledByUser" or something like that...

Status: NEW → ASSIGNED
Severity: -- → S2

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2b18f00410564714640de5cf7155968b1dd649ed

That broke css/css-flexbox/select-element-zero-height-002.html.
Presumably clip is excluded from the logic that makes is shrinkable to zero size with auto/hidden/scroll.

Also, the test I added pass locally but apparently synthesizeWheel is unreliable...

On Android, it appears comboboxes depends on overflow:clip to clip away the down-arrow for appearance:none, otherwise it creates overflow.

Yikes, what a mess...

I'd add the overflow: auto to this rule instead, probably. That's where we create a scrollframe unconditionally isn't it? Comboboxes otherwise are blocks.

Here's my attempt at writing a mochitest for this, for posterity...

Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/164543a1bf04 Make <select> list have 'overflow:auto' by default to indicate its scrollable. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: