Closed
Bug 320295
Opened 19 years ago
Closed 14 years ago
popupshowing gets called twice in some situations
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: mossop, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file)
1.00 KB,
application/vnd.mozilla.xul+xml
|
Details |
The popupshowing event for a context menu can be called twice in succession for a single popup in certain circumstances. The popuphiding event is only called once correctly. The trigger for this appears related to how the context menu is added to the XUL element. I observed this first on Firefox's content area context menu where it happens on all but the first tab. The difference here is that the first tab has its contextmenu attribute inherited through the XBL binding, while the others have the contextmenu attribute set through javascript. The upcoming testcase demonstrates this issue though for reasons that escape me right now it shows the situation reversed to that of the tabbrowser.
Reporter | ||
Comment 1•19 years ago
|
||
This testcase shows the problem. There are two boxes, red and blue. The blue has its context menu set by attributes. The red has it set by javascript. The popupshowing event for the popup adds a single menu item to the menu. The popuphiding event for the popup empties the menu. Right clicking the red box shows correctly that one menu item, so popupshowing was only called once. Right clicking the blue box shows two menu items so popupshowing was called twice. This has been tested on current trunk and Firefox 1.5 on Windows and Linux.
Reporter | ||
Comment 2•19 years ago
|
||
Forgot to add that the popupshown event appears to suffer the same problem.
Reporter | ||
Comment 3•19 years ago
|
||
As best I can tell this is being caused by popup listeners not being removed from XUL elements. Certainly removing then re-adding the contextmenu attribute in the example causes the menu size to increase by one for each time you remove the attribute. There is a somewhat telling line in the source: http://lxr.mozilla.org/mozilla/source/content/xul/content/src/nsXULElement.cpp#1425
Reporter | ||
Updated•19 years ago
|
Assignee: nobody → events
Component: XP Toolkit/Widgets: XUL → Event Handling
QA Contact: xptoolkit.xul → ian
Comment 4•19 years ago
|
||
Dave was referring to this line: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/xul/content/src/nsXULElement.cpp&rev=1.608&mark=1406#1404
Comment 5•19 years ago
|
||
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060204 SeaMonkey/1.5a] (nightly) (W98SE) The testcase is WorksForMe. (This is, at least, a reminder for myself: for bug 302050 comment 69)
Reporter | ||
Comment 6•19 years ago
|
||
Just confirming that. This appears to be working in the latest Seamonkey build, but still not working in the latest Firefox build.
Updated•15 years ago
|
Assignee: events → nobody
QA Contact: ian → events
Comment 7•14 years ago
|
||
Seems to work ok for me. Certainly fixed by popup work long ago.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Assignee | ||
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•