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

document.popupNode returns the wrong element

RESOLVED FIXED in mozilla0.9.5

Status

()

Core
XUL
--
major
RESOLVED FIXED
17 years ago
9 years ago

People

(Reporter: HJ, Assigned: David Hyatt)

Tracking

({helpwanted, regression})

Trunk
mozilla0.9.5
helpwanted, regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

1.08 KB, application/vnd.mozilla.xul+xml
Details
1.74 KB, application/vnd.mozilla.xul+xml
Details
802 bytes, patch
jag (Peter Annema)
: review+
Ben Goodger (use ben at mozilla dot org for email)
: superreview+
Details | Diff | Splinter Review
(Reporter)

Description

17 years ago
David Hyatt asked me to file this bug, so here it is :)

I wrote a small testcase, after having problems with the context menu (bug
78725). This example here will give you an impression of what i did to trigger
the bug.

<!-- start of snap -->
<tabbox>
  <tabs>
    <tab label="mytab" context="MyContextMenu">
  </tabs>
</tabbox>

<popupset>
  <popup id="MyContextMenu">
    <menuitem label="MenuItem"
oncommand="alert(document.popupNode.nodeName.toLowerCase())"/>
  </popup>
</popupset>
<!-- end of snap -->

result:
The alert in build 2001041704 shows 'tab' and the alert in build 2001050608
shows 'menuitem'. 

note:
I don't know if this is directly related to bug 78725 but if it is, please kill
that sucker asap.

Comment 1

17 years ago
I'm not entirely positive that this is my code causing the problem, but hyatt
and I noticed one oddity in the XUL popup listener, which is attempting to set
the popup node to the tooltip node. Not sure if that's it, though. I'll see.
Severity: normal → minor
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: regression
OS: Windows NT → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla0.9.1
(Reporter)

Comment 2

17 years ago
Created attachment 33661 [details]
xul testcase
(Reporter)

Comment 3

17 years ago
I just added a small xul testcase with one tab. If you right-click on the tab a
tab context menu will open, if bug 78725 doesn't prevent you from opening it.
And if it does, just reload the testcase. Click on the menuitem to see the alert.

Comment 4

17 years ago
Yep, I tried your testcase and have a variant of my own. Both show the bug. The
fix I mentioned (about tooltips) doesn't work... This'll take some heavier
hunting. Helpwanted!
Keywords: helpwanted

Comment 5

17 years ago
Might this be causing the bookmarks sidebar context menuitems to fail, and the
personal toolbar context menuitems to act as if I was right-clicking in the
sidebar? I'd be tempted to say document.popupNode now returns the selected node
instead of the node on which I right-clicked, but that's without looking at any
code.
If it's not cause of the wierdness with the bookmarks context menus then ignore,
but in the meantime i'm upgrading to major.
Severity: minor → major

Comment 6

17 years ago
By the way, the general thought here is that my checkin for bug 64313 caused
this, since it changes where document.popupNode is stored (it used to be a
member of nsXULDocument; now it's on nsFocusController and accessed through
either XULDocument or FocusController).

What may have happened, and what I'll look for, is that I set the popup node
myself somewhere entirely wrong...

Updated

17 years ago
Target Milestone: mozilla0.9.1 → mozilla0.9.2
(Reporter)

Comment 7

17 years ago
I sure hope that you get this fixed real soon. My multiZilla project is close to
nothing like it is now. I really _NEED_ document.popupNode for the
tabcontextmenu code to do anything. Or is there a workaround for this?
(Reporter)

Comment 8

17 years ago
Created attachment 34319 [details]
new testcase, see my next comment
(Reporter)

Comment 9

17 years ago
In all builds after 2001041704 both of the tabs show 'menuitem' as
document.popupNode and the third menuitem in the contextmenu, for the first tab,
shows 'yes' in builds after 2001041704.

Fabian wrote:
>I'd be tempted to say document.popupNode now returns the selected node
>instead of the node on which I right-clicked

Well, it's the same element for sure!

Something interesting:
The first tab shows 'tab' and the second tab 'menuitem' in build 2001041704.
The second tab produces the same error in build 2001041704 as in all later
builds. >>> The only difference here is a _tooltip_ on the popup node <<<

So if i set a tooltip on the popup node, it's over and out!
(Reporter)

Updated

17 years ago
Blocks: 80588

Comment 10

17 years ago
[spam] pushing off non-critical 0.9.2 bugs to 0.9.3. please take the helpwanted
keyword to heart if you'd like to see these fixed in 0.9.2!
Target Milestone: mozilla0.9.2 → mozilla0.9.3

Updated

17 years ago
Target Milestone: mozilla0.9.3 → Future

Comment 11

16 years ago
[spam] dr@netscape.com's bugs subject to redistribution by chofmann. R!
Assignee: dr → chofmann
Status: ASSIGNED → NEW
Priority: P3 → --
Target Milestone: Future → ---
(Assignee)

Comment 12

16 years ago
XUL bug.  Taking.
Assignee: chofmann → hyatt
Target Milestone: --- → mozilla0.9.7
(Assignee)

Updated

16 years ago
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.7 → mozilla0.9.5
(Assignee)

Comment 13

16 years ago
Created attachment 51201 [details] [diff] [review]
Only set popupnode for non-tooltip popups
Comment on attachment 51201 [details] [diff] [review]
Only set popupnode for non-tooltip popups

sr=ben@netscape.com
Attachment #51201 - Flags: superreview+

Comment 15

16 years ago
Comment on attachment 51201 [details] [diff] [review]
Only set popupnode for non-tooltip popups

r=jaggles
Attachment #51201 - Flags: review+
(Assignee)

Comment 16

16 years ago
Fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Updated

9 years ago
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.