Closed
Bug 133426
Opened 22 years ago
Closed 22 years ago
can't get coordinates from popup events
Categories
(Core :: XUL, defect, P2)
Core
XUL
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: hewitt, Assigned: hewitt)
Details
Attachments
(1 file, 1 obsolete file)
8.33 KB,
patch
|
mozilla
:
review+
hewitt
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
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•22 years ago
|
||
nominating, AIM needs this in order to restore the buddy tooltips feature
Assignee | ||
Comment 2•22 years ago
|
||
Comment 3•22 years ago
|
||
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•22 years ago
|
||
Attachment #76153 -
Attachment is obsolete: true
Assignee | ||
Comment 5•22 years ago
|
||
Comment on attachment 76337 [details] [diff] [review] new patch carrying over sr=jst
Attachment #76337 -
Flags: superreview+
Comment 6•22 years ago
|
||
Comment on attachment 76337 [details] [diff] [review] new patch r=jgaunt
Attachment #76337 -
Flags: review+
Comment 7•22 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•22 years ago
|
||
feexed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•22 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.
Description
•