Closed Bug 358576 Opened 18 years ago Closed 18 years ago

[FIX] Some combinations of popup menu popupanchor/popupalign are not implemented

Categories

(Core :: XUL, enhancement)

Other Branch
enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: testcase)

Attachments

(2 files)

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
Attached file Testcase #1
Attached patch Patch rev. 1Splinter Review
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.
Attachment #243955 - Flags: superreview?(roc)
Attachment #243955 - Flags: review?(roc)
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.

Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
Comment on attachment 243955 [details] [diff] [review]
Patch rev. 1

minusing as per Neil
Attachment #243955 - Flags: superreview?(roc)
Attachment #243955 - Flags: superreview-
Attachment #243955 - Flags: review?(roc)
Attachment #243955 - Flags: review-
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.
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.menus → xptoolkit.widgets
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.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: