mozilla/addon-sdk — pull request #776 by Mossop (2013-02-08 18:28:06+00:00)
Title: Bug 839318: context-menu should overflow based on the number of visible menu items

This removes the code that updates overflow when items are added or removed from the menu. When added if there is already an overflow then it adds there, otherwise it adds at top level.

When the context menu opens two stages run. First all the add-ons go through and set the visibility of their items. Then all the add-ons go and count how many visible items there are, if there are more than the overflow threshold then they make sure the items are in the overflow menu, if not they make sure they're at the top level. It's a little wasteful to have every add-on do this last stage, only one really needs to but it is also harmless.