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

can't get coordinates from popup events

VERIFIED FIXED in mozilla1.0

Status

()

Core
XUL
P2
normal
VERIFIED FIXED
16 years ago
9 years ago

People

(Reporter: Joe Hewitt (gone), Assigned: Joe Hewitt (gone))

Tracking

Trunk
mozilla1.0
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

8.33 KB, patch
John Gaunt (redfive)
: review+
Joe Hewitt (gone)
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

16 years ago
A long time ago I checked in something to allow event.clientX/Y properties to
work for popup events ("onpopupshowing" etc...).  This caused a crash and had to
be backed out (see bug 120237).

I need to fix this again so that tree (outliner) tooltips can be supported.
(Assignee)

Comment 1

16 years ago
nominating, AIM needs this in order to restore the buddy tooltips feature
Status: NEW → ASSIGNED
Keywords: nsbeta1
Priority: -- → P2
Target Milestone: --- → mozilla1.0
(Assignee)

Comment 2

16 years ago
Created attachment 76153 [details] [diff] [review]
patch
Comment on attachment 76153 [details] [diff] [review]
patch

>       mEvent = PR_NEWZAP(nsMutationEvent);
>       mEvent->eventStructType = NS_MUTATION_EVENT;
>     }
>+    else if (eventType.EqualsIgnoreCase("PopupEvents")) {
>+      mEvent = PR_NEWZAP(nsEvent);
>+      mEvent->eventStructType = NS_POPUP_EVENT;
>+    }
[...]
> NS_METHOD nsDOMEvent::GetClientX(PRInt32* aClientX)
> {
>   if (!mEvent || 
>-       (mEvent->eventStructType != NS_MOUSE_EVENT && mEvent->eventStructType != NS_DRAGDROP_EVENT) ||
>+       (mEvent->eventStructType != NS_MOUSE_EVENT &&
>+        mEvent->eventStructType != NS_POPUP_EVENT &&
>+        mEvent->eventStructType != NS_DRAGDROP_EVENT) ||
>       !mPresContext) {
>     *aClientX = 0;
>     return NS_OK;

This will cause the exact same problem that caused the original fix for this to
be backed out. nsDOMEvent::GetScreen[X|Y]() casts mEvent to nsGUIEvent, but
you're creating nsEvent objects for "PopupEvents" events, and not nsGUIEvent
objects. That needs fixin', make the nsDOMEvent constructor create nsGUIEvent
objects for "PopupEvents" events.

>-nsXULTooltipListener::GetTargetOutlinerBoxObject(nsIOutlinerBoxObject** aBoxObject)
>+nsXULTooltipListener::GetSourceOutlinerBoxObject(nsIOutlinerBoxObject** aBoxObject)
> {

This method needs to default *aBoxObject to nsnull.

[...]
>+  if (mIsSourceOutliner && mSourceNode) {
>+    nsCOMPtr<nsIContent> outlinerParent;
>+    mSourceNode->GetParent(*getter_AddRefs(outlinerParent));
>+    if (outlinerParent) {
>+      nsCOMPtr<nsIDOMXULElement> xulEl(do_QueryInterface(outlinerParent));

The above if (outlinerParent) check is unnecessary, do_QueryInterface() is null
safe.

>+      if (xulEl) {
>+        nsCOMPtr<nsIBoxObject> bx;
>+        xulEl->GetBoxObject(getter_AddRefs(bx));
>+        nsCOMPtr<nsIOutlinerBoxObject> obx(do_QueryInterface(bx));
>+        if (obx) {
>+          *aBoxObject = obx;
>+          NS_ADDREF(*aBoxObject);
>+          return NS_OK;
>+        }
>       }
>-    }
>+  }
>   }
>   return NS_ERROR_FAILURE;
> }

sr=jst if you fix that.
Attachment #76153 - Flags: superreview+
(Assignee)

Comment 4

16 years ago
Created attachment 76337 [details] [diff] [review]
new patch
Attachment #76153 - Attachment is obsolete: true
(Assignee)

Comment 5

16 years ago
Comment on attachment 76337 [details] [diff] [review]
new patch

carrying over sr=jst
Attachment #76337 - Flags: superreview+

Comment 6

16 years ago
Comment on attachment 76337 [details] [diff] [review]
new patch

r=jgaunt
Attachment #76337 - Flags: review+

Comment 7

16 years ago
Comment on attachment 76337 [details] [diff] [review]
new patch

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #76337 - Flags: approval+
(Assignee)

Comment 8

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

Updated

16 years ago
Keywords: nsbeta1 → nsbeta1+

Comment 9

16 years ago
v(stamp)
Status: RESOLVED → VERIFIED

Updated

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