Closed Bug 93839 Opened 23 years ago Closed 23 years ago

tooltiptext="" should work on all elements without specifying tooltip=""

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: hyatt, Assigned: hewitt)

References

Details

(Keywords: access, Whiteboard: [xul1.0-widgets])

Attachments

(2 files, 1 obsolete file)

tooltiptext="" should use an anonymous tooltip, so that the tooltip itself needn't be specified.
Blocks: 70753
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.5
I assume that this would take some sort of default tooltip look, like a yellow background with black text?
Wouldn't you be able to do multiline tooltips with <description>?
Yes, when I'm done, all tooltips will be multi-line by default.
Whiteboard: [xul1.0-widgets]
Depends on: 82409
removing dependency done in error
No longer depends on: 82409
Keywords: access, fcc508
Target Milestone: mozilla0.9.5 → mozilla0.9.6
*** Bug 80208 has been marked as a duplicate of this bug. ***
--> hewitt
Assignee: hyatt → hewitt
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.6 → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.7
Blocks: 74117
Blocks: 100701
Attached patch patch with implementation (obsolete) (deleted) — Splinter Review
Ok, so here's what I have done here. I am moving all of the tooltip listening stuff out of nsXULPopupListener and into layout. nsXULPopupListener will now only worry about popup and context popup types. I'm creating an anonymous tooltip element in nsDocElementBoxFrame, and storing a reference to it in nsRootBoxFrame. Whenever a xul frame is created for an element that wants a tooltip, nsRootBoxFrame will create a tooltip listener for it and send it on its merry way. This anonymous tooltip will be used for all elements that only have tooltiptext specified on them. tooltip="..." is still supported, of course. The default tooltip can be overriden by the user by placing a <tooltip default="true"/> in their document. There is also some special handling to support tooltips in outliners. As you hover over each cell in the outlinerbody the tooltip will change. You can determine which cell the mouse is over using the mouse coordinates from onpopupshow* events and outlinerBoxObject.getCellAt (see bug 112286).
sr=hyatt + if (aModType == 3) // removal + rootBox->RemoveTooltipSupport(aContent); + if (aModType == 2) // addition + rootBox->AddTooltipSupport(aContent); Ick. Use the real constants here, not hardcoded numbers. Also, my sr is conditional on you running the leak tests to make sure this doesn't leak.
I ran the leak log and there were no extra leaks with this patch turned on. I tested created and destroying a bunch of xul documents and showing a variety of tooltips.
a few things: 1) could you step through in the debugger to make sure that the dtor for nsXULTooltipListener is actually getting called? Just being paranoid. 2) I'm not familiar with nsDocElementBoxFrame. We're creating tooltip node for every one of these, regardless? Doesn't that sound a bit wasteful? How many of these are there in, say, the navigator window? 3) Check that the TITLE attribute still works (just a reminder, i'm sure it does).
1). Yes, the destructor is called when the tooltip source content goes away. 2). There is only one nsDocElementBoxFrame per XUL window, so, there will only be one tooltip content instance created for the navigator window, or 2 if you have the sidebar open with a xul page visible. 3). Yes, the title attribute still works in html pages.
This hasn't been checked in yet has it?
Attached patch new patch with titletip support (deleted) — Splinter Review
I had implemented titletips in xbl/js a long time ago, but never really liked doing it that way. This new version of the patch rolls titletip support into the C++ tooltip listener, which is a much cleaner way to do it. Also, I moved that 21px top offset we had hard-coded in C++ and moved it into CSS as a margin.
Attachment #59676 - Attachment is obsolete: true
Comment on attachment 60146 [details] [diff] [review] new patch with titletip support r=pink, looking good
Attachment #60146 - Flags: review+
fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: