If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED INVALID

Status

()

Core
XUL
--
enhancement
RESOLVED INVALID
11 years ago
9 years ago

People

(Reporter: mats, Assigned: mats)

Tracking

({testcase})

Other Branch
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

11 years ago
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
(Assignee)

Comment 1

11 years ago
Created attachment 243953 [details]
Testcase #1
(Assignee)

Comment 2

11 years ago
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.
Attachment #243955 - Flags: superreview?(roc)
Attachment #243955 - Flags: review?(roc)

Comment 3

11 years ago
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
Last Resolved: 11 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-
(Assignee)

Comment 5

11 years ago
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

Comment 6

11 years ago
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. 
(Assignee)

Comment 7

11 years ago
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.

Updated

9 years ago
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.