Some combinations of popup menu popupanchor/popupalign are not implemented. http://developer.mozilla.org/en/docs/XUL:Method:showPopup Using them gives the warning: WARNING: Hmmm, looks like you've hit a anchor/align case we weren't setup for.: file nsMenuPopupFrame.cpp, line 659 The code: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp&rev=1.294&root=/cvsroot&mark=606-659#579
Created attachment 243955 [details] [diff] [review] Patch rev. 1 This patch adds three new values, 'topmiddle' 'bottommiddle' and 'center', to the existing four and implements all 49 combinations. Let me know if you want 'leftmiddle' and 'rightmiddle' for consistency, they should be trivial to add.
popupalign and popupanchor are deprecated and should not be used. Do not add new values for it. Bug 279703 will deprecate the entire showPopup API.
Comment on attachment 243955 [details] [diff] [review] Patch rev. 1 minusing as per Neil
Hmm, so how would I position a popup centered as in the screenshot below using the new API? http://img221.imageshack.us/my.php?image=303192vd0.png
I'm not sure if that would be useful enough to build in support for centering popups considering that there would be so many possible combinations. But if you did, it would involve the position attribute.
Well, implementing all 49 combinations of 7 values takes roughly the same amount of code as the 9 combinations of 4 values that are currently implemented (7 are broken AFAICT). I'll have a look again should we decide to implement the accesskey popup menu as I suggested in bug 303192.
Centering a panel in a large parent element is difficult considering that the popup's natural width and height are not accessible until onpopupshown, which means there is a flash of motion as the panel is moved to the center.