Open Bug 1368255 Opened 7 years ago Updated 2 years ago

Overflow panel code is confused if CustomizableUI.reset() removes items directly from the overflow panel

Categories

(Firefox :: Toolbars and Customization, enhancement, P4)

53 Branch
enhancement

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

Details

(Whiteboard: [reserve-photon-structure])

When initially landing bug 1354078, tests went orange because the original version of the browser_overflow_use_subviews.js test calls CustomizableUI.reset() while the window is resized and the overflow button is displayed (and its panel contains items that should not be there).

This doesn't actually happen regularly in practical use because the only UI entrypoint for reset() is in customize mode, which will disable the overflow menu. However, it could still happen in multiple-window situations or when add-ons call CUI.reset(). Potentially related: bug 1323607.


The cause of the issue here is that we keep a list of items in the overflow panel and their sizes as a map from ids to sizes, i.e. https://hg.mozilla.org/mozilla-central/annotate/bce03a8eac301bcd9408b22333b1a67c3eaed057/browser/components/customizableui/CustomizableUI.jsm#l4036 . We rely on this map when trying to decide whether we should add a button's node to the navbar or the overflow panel, here: https://dxr.mozilla.org/mozilla-central/rev/bce03a8eac301bcd9408b22333b1a67c3eaed057/browser/components/customizableui/CustomizableUI.jsm#4411-4412 .

This code assumes that if there are remaining items in the map of collapsed items, we should add items to the overflow panel. In this particular scenario, that assumption is broken, because we've removed the actual overflowed items from the list, but they've somehow been left in this ._collapsed map, and so its size no longer corresponds to the number of items that are actually in the panel at this point.

Setting qe-verify- because this would be tricky to trigger in practice and really just needs another automated test to verify when fixed.
Flags: qe-verify-
Priority: -- → P3
Whiteboard: [photon-structure][triage] → [reserve-photon-structure]
Priority: P3 → P4
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.